From b2b2655c1e43b867d2108894e6d03f392fa59b24 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:07:39 -0500 Subject: [PATCH 01/16] style: remove decorative comment separators --- .vscode/settings.json | 3 +++ pkg/deltanet/node.go | 14 -------------- pkg/lambda/expression.go | 8 -------- pkg/saccharine/expression.go | 4 ---- pkg/saccharine/statement.go | 4 ---- 5 files changed, 3 insertions(+), 30 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..082b194 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "makefile.configureOnOpen": false +} \ No newline at end of file diff --git a/pkg/deltanet/node.go b/pkg/deltanet/node.go index 91a77d0..bdf99cd 100644 --- a/pkg/deltanet/node.go +++ b/pkg/deltanet/node.go @@ -1,7 +1,5 @@ package deltanet -/** ------------------------------------------------------------------------- */ - // A connection between exactly two nodes in a graph. type Edge struct { A, B Node @@ -28,8 +26,6 @@ func (e Edge) IsPrincipleEdge() bool { return e.A.GetMainPort() == e && e.B.GetMainPort() == e } -/** ------------------------------------------------------------------------- */ - type Node interface { // Returns the principle port that the node is attached to. GetMainPort() Edge @@ -42,8 +38,6 @@ type Node interface { GetLabel() string } -/** ------------------------------------------------------------------------- */ - type EraserNode struct { Main Edge } @@ -52,8 +46,6 @@ func (n EraserNode) GetLabel() string { return "Ⓧ" } func (n EraserNode) GetMainPort() Edge { return n.Main } func (n EraserNode) GetAuxPorts() []Edge { return []Edge{} } -/** ------------------------------------------------------------------------- */ - type ReplicatorNode struct { Main Edge Level uint @@ -68,8 +60,6 @@ func (n ReplicatorNode) GetAuxPorts() []Edge { return n.Aux } // Returns the level of the replicator node. func (n ReplicatorNode) GetLevel() uint { return n.Level } -/** ------------------------------------------------------------------------- */ - type FanNode struct { Label string Main Edge @@ -80,8 +70,6 @@ func (n FanNode) GetLabel() string { return n.Label } func (n FanNode) GetMainPort() Edge { return n.Main } func (n FanNode) GetAuxPorts() []Edge { return []Edge{n.Left, n.Right} } -/** ------------------------------------------------------------------------- */ - type TerminalNode struct { Label string Main Edge @@ -90,5 +78,3 @@ type TerminalNode struct { func (n TerminalNode) GetLabel() string { return n.Label } func (n TerminalNode) GetMainPort() Edge { return n.Main } func (n TerminalNode) GetAuxPorts() []Edge { return []Edge{} } - -/** ------------------------------------------------------------------------- */ diff --git a/pkg/lambda/expression.go b/pkg/lambda/expression.go index e2814b2..e96090d 100644 --- a/pkg/lambda/expression.go +++ b/pkg/lambda/expression.go @@ -5,8 +5,6 @@ type Expression interface { Copy() Expression } -/** ------------------------------------------------------------------------- */ - type Abstraction struct { Parameter string Body Expression @@ -24,8 +22,6 @@ func NewAbstraction(parameter string, body Expression) *Abstraction { return &Abstraction{Parameter: parameter, Body: body} } -/** ------------------------------------------------------------------------- */ - type Application struct { Abstraction Expression Argument Expression @@ -43,8 +39,6 @@ func NewApplication(function Expression, argument Expression) *Application { return &Application{Abstraction: function, Argument: argument} } -/** ------------------------------------------------------------------------- */ - type Variable struct { Value string } @@ -61,8 +55,6 @@ func NewVariable(name string) *Variable { return &Variable{Value: name} } -/** ------------------------------------------------------------------------- */ - type Visitor interface { VisitAbstraction(*Abstraction) VisitApplication(*Application) diff --git a/pkg/saccharine/expression.go b/pkg/saccharine/expression.go index 80c8f1b..fb4e7f8 100644 --- a/pkg/saccharine/expression.go +++ b/pkg/saccharine/expression.go @@ -4,8 +4,6 @@ type Expression interface { IsExpression() } -/** ------------------------------------------------------------------------- */ - type Abstraction struct { Parameters []string Body Expression @@ -30,8 +28,6 @@ func (Application) IsExpression() {} func (Atom) IsExpression() {} func (Clause) IsExpression() {} -/** ------------------------------------------------------------------------- */ - func NewAbstraction(parameter []string, body Expression) *Abstraction { return &Abstraction{Parameters: parameter, Body: body} } diff --git a/pkg/saccharine/statement.go b/pkg/saccharine/statement.go index 1d0dd15..2a5b938 100644 --- a/pkg/saccharine/statement.go +++ b/pkg/saccharine/statement.go @@ -4,8 +4,6 @@ type Statement interface { IsStatement() } -/** ------------------------------------------------------------------------- */ - type LetStatement struct { Name string Parameters []string @@ -19,8 +17,6 @@ type DeclareStatement struct { func (LetStatement) IsStatement() {} func (DeclareStatement) IsStatement() {} -/** ------------------------------------------------------------------------- */ - func NewLet(name string, parameters []string, body Expression) *LetStatement { return &LetStatement{Name: name, Parameters: parameters, Body: body} } -- 2.49.1 From 9f06a5109f20eed163efb5a088098ce12cbd5be5 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:11:37 -0500 Subject: [PATCH 02/16] style: remove comments from golangci config --- .golangci.yml | 152 +------------------------------------------------- 1 file changed, 3 insertions(+), 149 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index a9a6f07..4f29c97 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,230 +1,84 @@ --- -# golangci-lint configuration file made by @ccoVeille -# Source: https://github.com/ccoVeille/golangci-lint-config-examples/ -# Author: @ccoVeille -# License: MIT -# Variant: 03-safe -# Version: v2.0.0 -# version: "2" formatters: enable: - # format the code - gofmt - # format the block of imports - gci settings: - # format the code with Go standard library gofmt: - # simplify the code - # https://pkg.go.dev/cmd/gofmt#hdr-The_simplify_command simplify: true rewrite-rules: - # replace `interface{}` with `any` in the code on format - pattern: 'interface{}' replacement: 'any' - - # make sure imports are always in a deterministic order - # https://github.com/daixiang0/gci/ - gci: # define the section orders for imports + + gci: sections: - # Standard section: captures all standard packages. - standard - # Default section: catchall that is not standard or custom - default - # linters that related to local tool, so they should be separated - localmodule linters: exclusions: - # these presets where present in the v1 version of golangci-lint - # it's interesting to keep them when migrating, but removing them should be the goal presets: - # exclude check on comments format in godoc - # These are common false positives in poor code - # you should not use this on recent code you write from scratch - # More information: https://golangci-lint.run/usage/false-positives/#comments - # - # Please uncomment the following line if your code is not using the godoc format - comments - - # Common false positives - # feel free to remove this if you don't have any false positives - # More information: https://golangci-lint.run/usage/false-positives/#common-false-positives - common-false-positives - - # Legacy preset is not recommended anymore - # More information: https://golangci-lint.run/usage/false-positives/#legacy - legacy - - # std-error-handling is a set of rules that avoid reporting unhandled errors on common functions/methods - # More information: https://golangci-lint.run/usage/false-positives/#std-error-handling - std-error-handling - # some linters are enabled by default - # https://golangci-lint.run/usage/linters/ - # - # enable some extra linters enable: - # Errcheck is a program for checking for unchecked errors in Go code. - errcheck - - # Vet examines Go source code and reports suspicious constructs. - govet - - # Detects when assignments to existing variables are not used. - ineffassign - - # It's a set of rules from staticcheck. See https://staticcheck.io/ - staticcheck - - # Checks Go code for unused constants, variables, functions and types. - unused - - # Fast, configurable, extensible, flexible, and beautiful linter for Go. - # Drop-in replacement of golint. - revive - - # make sure to use t.Helper() when needed - thelper - - # mirror suggests rewrites to avoid unnecessary []byte/string conversion - mirror - - # detect the possibility to use variables/constants from the Go standard library. - usestdlibvars - - # Finds commonly misspelled English words. - misspell - - # Checks for duplicate words in the source code. - dupword - - # linter to detect errors invalid key values count - loggercheck - - # detect when a package or method could be replaced by one from the standard library - exptostd - - # detects nested contexts in loops or function literals - fatcontext - - # Reports uses of functions with replacement inside the testing package. - usetesting settings: revive: rules: - # these are the default revive rules - # you can remove the whole "rules" node if you want - # BUT - # ! /!\ they all need to be present when you want to add more rules than the default ones - # otherwise, you won't have the default rules, but only the ones you define in the "rules" node - - # Blank import should be only in a main or test package, or have a comment justifying it. - name: blank-imports - - # context.Context() should be the first parameter of a function when provided as argument. - name: context-as-argument arguments: - allowTypesBefore: "*testing.T" - - # Basic types should not be used as a key in `context.WithValue` - name: context-keys-type - - # Importing with `.` makes the programs much harder to understand - name: dot-imports - - # Empty blocks make code less readable and could be a symptom of a bug or unfinished refactoring. - name: empty-block - - # for better readability, variables of type `error` must be named with the prefix `err`. - name: error-naming - - # for better readability, the errors should be last in the list of returned values by a function. - name: error-return - - # for better readability, error messages should not be capitalized or end with punctuation or a newline. - name: error-strings - - # report when replacing `errors.New(fmt.Sprintf())` with `fmt.Errorf()` is possible - name: errorf - - # check naming and commenting conventions on exported symbols. - name: exported arguments: - # make error messages clearer - "sayRepetitiveInsteadOfStutters" - - # incrementing an integer variable by 1 is recommended to be done using the `++` operator - name: increment-decrement - - # highlights redundant else-blocks that can be eliminated from the code - # - name: indent-error-flow - - # This rule suggests a shorter way of writing ranges that do not use the second value. - name: range - - # receiver names in a method should reflect the struct name (p for Person, for example) - name: receiver-naming - - # redefining built in names (true, false, append, make) can lead to bugs very difficult to detect. - name: redefines-builtin-id - - # redundant else-blocks that can be eliminated from the code. - # - name: superfluous-else - - # prevent confusing name for variables when using `time` package - name: time-naming - - # warns when an exported function or method returns a value of an un-exported type. - name: unexported-return - - # spots and proposes to remove unreachable code. also helps to spot errors - name: unreachable-code - - # Functions or methods with unused parameters can be a symptom of an unfinished refactoring or a bug. - name: unused-parameter - - # report when a variable declaration can be simplified - name: var-declaration - - # warns when initialism, variable or package naming conventions are not followed. - name: var-naming misspell: - # Correct spellings using locale preferences for US or UK. - # Setting locale to US will correct the British spelling of 'colour' to 'color'. - # Default ("") is to use a neutral variety of English. locale: US - - # List of words to ignore - # among the one defined in https://github.com/golangci/misspell/blob/master/words.go ignore-rules: [] - # - valor - # - and - - # Extra word corrections. extra-words: [] - # - typo: "whattever" - # correction: "whatever" output: - # Order to use when sorting results. - # Possible values: `file`, `linter`, and `severity`. - # - # If the severity values are inside the following list, they are ordered in this order: - # 1. error - # 2. warning - # 3. high - # 4. medium - # 5. low - # Either they are sorted alphabetically. - # - # Default: ["file"] sort-order: - linter - severity - - file # filepath, line, and column. \ No newline at end of file + - file -- 2.49.1 From 7e59d5cefab928b1c4f459db0fdb2bf0f8070ac4 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:12:30 -0500 Subject: [PATCH 03/16] style: remove YAML document separator --- .golangci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 4f29c97..a4a1c02 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,3 @@ ---- version: "2" formatters: -- 2.49.1 From dc9a1b2b7d46dae9a83b171231d57a09b6350e1d Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:21:22 -0500 Subject: [PATCH 04/16] feat: add usage instructions to README and improve Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 42c6777..4c0268a 100644 --- a/Makefile +++ b/Makefile @@ -18,4 +18,4 @@ explain: it graph: @ go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof @ go tool pprof -svg profile/cpu.prof > profile/cpu.svg - @ open profile/cpu.svg + @ echo "Profile graph saved to 'file://profile/cpu.svg'" -- 2.49.1 From 0d06fac919351903afaa4a4cee8fa456593a8a56 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:27:42 -0500 Subject: [PATCH 05/16] fix: remove Windows .exe extension from binary name Changed BINARY_NAME from lambda.exe to lambda for Unix systems. The .exe extension is a Windows convention and is inappropriate for macOS/Linux builds. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4c0268a..9b3a37d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -BINARY_NAME=lambda.exe +BINARY_NAME=lambda it: @ go build -o ${BINARY_NAME} ./cmd/lambda @@ -7,13 +7,13 @@ it: TEST=simple run: it - @ ./lambda.exe - < ./samples/$(TEST).txt > program.out + @ ./lambda - < ./samples/$(TEST).txt > program.out profile: it - @ ./lambda.exe -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out + @ ./lambda -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out explain: it - @ ./lambda.exe -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out + @ ./lambda -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out graph: @ go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof -- 2.49.1 From e0b0b92a8aa4e9c2673871ff16297d1f9068f342 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:27:55 -0500 Subject: [PATCH 06/16] refactor: remove redundant chmod +x command Go build already sets the executable bit on binaries, making the explicit chmod +x unnecessary. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 9b3a37d..6b47c10 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ BINARY_NAME=lambda it: @ go build -o ${BINARY_NAME} ./cmd/lambda - @ chmod +x ${BINARY_NAME} TEST=simple -- 2.49.1 From e5ceeb2fcc061fadad98743cd06b1c97af6f05a4 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:28:08 -0500 Subject: [PATCH 07/16] feat: add .PHONY declarations for all targets Declares all non-file targets as phony to prevent conflicts with files of the same name and improve Make's performance. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 6b47c10..ed73e39 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ BINARY_NAME=lambda +.PHONY: it run profile explain graph + it: @ go build -o ${BINARY_NAME} ./cmd/lambda -- 2.49.1 From 7927df466044eaace67f43f2eeab14b870ff6123 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:28:29 -0500 Subject: [PATCH 08/16] feat: add clean target to remove build artifacts Adds standard clean target to remove binary, output files, and profile directory. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ed73e39..b4c19b0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BINARY_NAME=lambda -.PHONY: it run profile explain graph +.PHONY: it run profile explain graph clean it: @ go build -o ${BINARY_NAME} ./cmd/lambda @@ -20,3 +20,7 @@ graph: @ go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof @ go tool pprof -svg profile/cpu.prof > profile/cpu.svg @ echo "Profile graph saved to 'file://profile/cpu.svg'" + +clean: + rm -f ${BINARY_NAME} program.out + rm -rf profile/ -- 2.49.1 From 24fdc1c17c442211b2cf04014b0265bd15bd8f32 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:28:48 -0500 Subject: [PATCH 09/16] feat: add help target to document available commands Adds help target that displays all available Make targets and their descriptions, improving discoverability. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b4c19b0..736991d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,17 @@ BINARY_NAME=lambda -.PHONY: it run profile explain graph clean +.PHONY: help it run profile explain graph clean + +help: + @ echo "Available targets:" + @ echo " it - Build the lambda binary" + @ echo " run - Build and run with sample input (default: simple.txt)" + @ echo " profile - Build and run with CPU profiling enabled" + @ echo " explain - Run with explanation mode and profiling" + @ echo " graph - Generate CPU profile visualization" + @ echo " clean - Remove build artifacts" + @ echo "" + @ echo "Usage: make run TEST=" it: @ go build -o ${BINARY_NAME} ./cmd/lambda -- 2.49.1 From bb48d0777b4e00b7deab7b5186251e89dd01d88c Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:29:09 -0500 Subject: [PATCH 10/16] fix: ensure profile directory exists before writing Creates profile directory in profile and explain targets to prevent errors on first run. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 736991d..c082662 100644 --- a/Makefile +++ b/Makefile @@ -22,9 +22,11 @@ run: it @ ./lambda - < ./samples/$(TEST).txt > program.out profile: it + @ mkdir -p profile @ ./lambda -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out explain: it + @ mkdir -p profile @ ./lambda -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out graph: -- 2.49.1 From 3158c35df2743d5341ebc76b526dc647c3494081 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:29:25 -0500 Subject: [PATCH 11/16] fix: add profile dependency to graph target Makes graph target depend on profile to ensure cpu.prof exists before attempting to generate visualizations. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c082662..edcc7e9 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ explain: it @ mkdir -p profile @ ./lambda -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out -graph: +graph: profile @ go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof @ go tool pprof -svg profile/cpu.prof > profile/cpu.svg @ echo "Profile graph saved to 'file://profile/cpu.svg'" -- 2.49.1 From 8f70bfbbdb3e2b8d32fabcb2d927e960d912e7d8 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:34:07 -0500 Subject: [PATCH 12/16] refactor: use .SILENT directive instead of @ prefixes Adds .SILENT directive to suppress command echoing for all targets, replacing individual @ prefixes. Also moves TEST variable to top with other variables for better organization. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index edcc7e9..3369ccf 100644 --- a/Makefile +++ b/Makefile @@ -1,38 +1,38 @@ BINARY_NAME=lambda +TEST=simple +.SILENT: .PHONY: help it run profile explain graph clean help: - @ echo "Available targets:" - @ echo " it - Build the lambda binary" - @ echo " run - Build and run with sample input (default: simple.txt)" - @ echo " profile - Build and run with CPU profiling enabled" - @ echo " explain - Run with explanation mode and profiling" - @ echo " graph - Generate CPU profile visualization" - @ echo " clean - Remove build artifacts" - @ echo "" - @ echo "Usage: make run TEST=" + echo "Available targets:" + echo " it - Build the lambda binary" + echo " run - Build and run with sample input (default: simple.txt)" + echo " profile - Build and run with CPU profiling enabled" + echo " explain - Run with explanation mode and profiling" + echo " graph - Generate CPU profile visualization" + echo " clean - Remove build artifacts" + echo "" + echo "Usage: make run TEST=" it: - @ go build -o ${BINARY_NAME} ./cmd/lambda - -TEST=simple + go build -o ${BINARY_NAME} ./cmd/lambda run: it - @ ./lambda - < ./samples/$(TEST).txt > program.out + ./lambda - < ./samples/$(TEST).txt > program.out profile: it - @ mkdir -p profile - @ ./lambda -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out + mkdir -p profile + ./lambda -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out explain: it - @ mkdir -p profile - @ ./lambda -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out + mkdir -p profile + ./lambda -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out graph: profile - @ go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof - @ go tool pprof -svg profile/cpu.prof > profile/cpu.svg - @ echo "Profile graph saved to 'file://profile/cpu.svg'" + go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof + go tool pprof -svg profile/cpu.prof > profile/cpu.svg + echo "Profile graph saved to 'file://profile/cpu.svg'" clean: rm -f ${BINARY_NAME} program.out -- 2.49.1 From 997794eaa502019710d8757e99847431800e5b90 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:36:13 -0500 Subject: [PATCH 13/16] docs: add documentation of Makefile improvements Documents all issues found and fixes applied to the Makefile, including both implemented changes and remaining suggestions. Co-Authored-By: Claude Sonnet 4.5 --- makefile-improvements.md | 114 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 makefile-improvements.md diff --git a/makefile-improvements.md b/makefile-improvements.md new file mode 100644 index 0000000..72ee51c --- /dev/null +++ b/makefile-improvements.md @@ -0,0 +1,114 @@ +# Makefile Improvements + +This document lists the issues identified in the original Makefile and the improvements that were implemented. + +## Issues Fixed + +### 1. Hardcoded `.exe` extension on Unix +**Problem**: `BINARY_NAME=lambda.exe` used a Windows extension on macOS/Linux systems. + +**Solution**: Changed to `BINARY_NAME=lambda` since Unix executables don't use extensions. + +**Commit**: `0d06fac` - fix: remove Windows .exe extension from binary name + +--- + +### 2. Redundant `chmod +x` +**Problem**: The `chmod +x` command was unnecessary since `go build` already sets the executable bit. + +**Solution**: Removed the redundant `chmod +x ${BINARY_NAME}` line. + +**Commit**: `e0b0b92` - refactor: remove redundant chmod +x command + +--- + +### 3. Missing `.PHONY` declarations +**Problem**: Without `.PHONY`, if files named `run`, `graph`, etc. existed, Make would skip those targets. + +**Solution**: Added `.PHONY: help it run profile explain graph clean` declaration. + +**Commit**: `e5ceeb2` - feat: add .PHONY declarations for all targets + +--- + +### 4. No `clean` target +**Problem**: No standard way to remove build artifacts. + +**Solution**: Added `clean` target to remove binary, output files, and profile directory: +```makefile +clean: + rm -f ${BINARY_NAME} program.out + rm -rf profile/ +``` + +**Commit**: `7927df4` - feat: add clean target to remove build artifacts + +--- + +### 5. Missing `help` or default target +**Problem**: Running `make` with no arguments was unclear about available targets. + +**Solution**: Added `help` target documenting all available commands and their usage. + +**Commit**: `24fdc1c` - feat: add help target to document available commands + +--- + +### 6. Profile directory not created +**Problem**: The `profile` and `explain` targets wrote to `profile/cpu.prof` but never created the directory, causing failures on first run. + +**Solution**: Added `mkdir -p profile` to both `profile` and `explain` targets. + +**Commit**: `bb48d07` - fix: ensure profile directory exists before writing + +--- + +### 7. No dependency check on `graph` +**Problem**: The `graph` target assumed `profile/cpu.prof` exists but didn't depend on `profile`. + +**Solution**: Changed `graph:` to `graph: profile` to ensure profiling runs first. + +**Commit**: `3158c35` - fix: add profile dependency to graph target + +--- + +### 8. Verbose command prefixes +**Problem**: Every command used `@` prefix individually to suppress output, cluttering the file. + +**Solution**: Added `.SILENT:` directive at the top and removed all `@` prefixes. Also moved `TEST` variable to top with other variables. + +**Commit**: `8f70bfb` - refactor: use .SILENT directive instead of @ prefixes + +--- + +## Additional Suggestions (Not Yet Implemented) + +### 9. Missing `lambda` binary in `.gitignore` +**Issue**: The `.gitignore` has `*.exe` but not the actual `lambda` binary name. Since we removed the `.exe` extension, the binary won't be ignored. + +**Recommendation**: Add `lambda` to `.gitignore`: +``` +# Build artifacts +lambda +``` + +--- + +### 10. No explicit default target +**Issue**: While `help` is currently the first target (and thus default), it's not explicitly declared. + +**Recommendation**: Add `.DEFAULT_GOAL = help` at the top for clarity: +```makefile +BINARY_NAME=lambda +TEST=simple + +.DEFAULT_GOAL := help +.SILENT: +.PHONY: help it run profile explain graph clean +``` + +--- + +## Summary + +The Makefile has been significantly improved with better organization, proper dependency management, directory creation, helpful documentation, and cleaner syntax. The remaining suggestions are minor quality-of-life improvements that can be addressed as needed. -- 2.49.1 From b3db983f62aec7f3e2341367cb4198c54eab88e8 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:38:19 -0500 Subject: [PATCH 14/16] fix: add lambda binary to .gitignore Adds the lambda binary to .gitignore to prevent accidentally committing the build artifact. Previously only *.exe was ignored, which didn't cover the Unix binary name. Co-Authored-By: Claude Sonnet 4.5 --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 71b2ceb..8ea5372 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ *.so *.dylib +# Build artifacts +lambda + # Test binary, built with `go test -c` *.test -- 2.49.1 From edfee89bad1358500de16321dbc12bfe94a0b098 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 16:38:37 -0500 Subject: [PATCH 15/16] feat: explicitly set help as default target Adds .DEFAULT_GOAL := help to make it clear that running 'make' with no arguments will display the help message. Co-Authored-By: Claude Sonnet 4.5 --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 3369ccf..fe7f1b9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ BINARY_NAME=lambda TEST=simple +.DEFAULT_GOAL := help .SILENT: .PHONY: help it run profile explain graph clean -- 2.49.1 From b6133aa76e9366b71fef9d9de3143f0454064e01 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 10 Jan 2026 17:15:14 -0500 Subject: [PATCH 16/16] docs: remove makefile-improvements.md in favor of CLAUDE.md Co-Authored-By: Claude Sonnet 4.5 --- makefile-improvements.md | 114 --------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 makefile-improvements.md diff --git a/makefile-improvements.md b/makefile-improvements.md deleted file mode 100644 index 72ee51c..0000000 --- a/makefile-improvements.md +++ /dev/null @@ -1,114 +0,0 @@ -# Makefile Improvements - -This document lists the issues identified in the original Makefile and the improvements that were implemented. - -## Issues Fixed - -### 1. Hardcoded `.exe` extension on Unix -**Problem**: `BINARY_NAME=lambda.exe` used a Windows extension on macOS/Linux systems. - -**Solution**: Changed to `BINARY_NAME=lambda` since Unix executables don't use extensions. - -**Commit**: `0d06fac` - fix: remove Windows .exe extension from binary name - ---- - -### 2. Redundant `chmod +x` -**Problem**: The `chmod +x` command was unnecessary since `go build` already sets the executable bit. - -**Solution**: Removed the redundant `chmod +x ${BINARY_NAME}` line. - -**Commit**: `e0b0b92` - refactor: remove redundant chmod +x command - ---- - -### 3. Missing `.PHONY` declarations -**Problem**: Without `.PHONY`, if files named `run`, `graph`, etc. existed, Make would skip those targets. - -**Solution**: Added `.PHONY: help it run profile explain graph clean` declaration. - -**Commit**: `e5ceeb2` - feat: add .PHONY declarations for all targets - ---- - -### 4. No `clean` target -**Problem**: No standard way to remove build artifacts. - -**Solution**: Added `clean` target to remove binary, output files, and profile directory: -```makefile -clean: - rm -f ${BINARY_NAME} program.out - rm -rf profile/ -``` - -**Commit**: `7927df4` - feat: add clean target to remove build artifacts - ---- - -### 5. Missing `help` or default target -**Problem**: Running `make` with no arguments was unclear about available targets. - -**Solution**: Added `help` target documenting all available commands and their usage. - -**Commit**: `24fdc1c` - feat: add help target to document available commands - ---- - -### 6. Profile directory not created -**Problem**: The `profile` and `explain` targets wrote to `profile/cpu.prof` but never created the directory, causing failures on first run. - -**Solution**: Added `mkdir -p profile` to both `profile` and `explain` targets. - -**Commit**: `bb48d07` - fix: ensure profile directory exists before writing - ---- - -### 7. No dependency check on `graph` -**Problem**: The `graph` target assumed `profile/cpu.prof` exists but didn't depend on `profile`. - -**Solution**: Changed `graph:` to `graph: profile` to ensure profiling runs first. - -**Commit**: `3158c35` - fix: add profile dependency to graph target - ---- - -### 8. Verbose command prefixes -**Problem**: Every command used `@` prefix individually to suppress output, cluttering the file. - -**Solution**: Added `.SILENT:` directive at the top and removed all `@` prefixes. Also moved `TEST` variable to top with other variables. - -**Commit**: `8f70bfb` - refactor: use .SILENT directive instead of @ prefixes - ---- - -## Additional Suggestions (Not Yet Implemented) - -### 9. Missing `lambda` binary in `.gitignore` -**Issue**: The `.gitignore` has `*.exe` but not the actual `lambda` binary name. Since we removed the `.exe` extension, the binary won't be ignored. - -**Recommendation**: Add `lambda` to `.gitignore`: -``` -# Build artifacts -lambda -``` - ---- - -### 10. No explicit default target -**Issue**: While `help` is currently the first target (and thus default), it's not explicitly declared. - -**Recommendation**: Add `.DEFAULT_GOAL = help` at the top for clarity: -```makefile -BINARY_NAME=lambda -TEST=simple - -.DEFAULT_GOAL := help -.SILENT: -.PHONY: help it run profile explain graph clean -``` - ---- - -## Summary - -The Makefile has been significantly improved with better organization, proper dependency management, directory creation, helpful documentation, and cleaner syntax. The remaining suggestions are minor quality-of-life improvements that can be addressed as needed. -- 2.49.1