Micah Cantor's Avatar

Micah Cantor

@micahcantor.bsky.social

Software engineer @ Rinse • Grinnell College '24 • Washington, DC https://micahcantor.com

41 Followers  |  57 Following  |  30 Posts  |  Joined: 15.11.2024  |  2.2752

Latest posts by micahcantor.bsky.social on Bluesky

Haskell’s error messages are horrific. Their language is mostly aimed at a very academic audience and is one of the main reasons the language is so inaccessible.

19.07.2025 21:07 — 👍 1    🔁 0    💬 2    📌 0
Slideshow: Figure and Presentation Tools

Racket's slideshow package is fun

docs.racket-lang.org/slideshow/

18.04.2025 15:04 — 👍 0    🔁 0    💬 0    📌 0

Analogous in a way to cursive handwriting

07.04.2025 18:39 — 👍 4    🔁 0    💬 0    📌 0
Preview
Everyone gets bidirectional BFS wrong People really need to stop blindly copying code from the Internet.

What happens when LLMs train on code that's popular but wrong? zdimension.fr/everyone-get... explores this, with interactive diagrams exploring the error

04.02.2025 19:24 — 👍 85    🔁 19    💬 3    📌 1

Abstract syntax trees but they’re actually made out of…published abstracts?

04.02.2025 22:15 — 👍 2    🔁 0    💬 1    📌 0
Data.IntMap

Probably you should use vector (hackage.haskell.org/package/vector) or Text.

And if you need efficient add/delete then maybe IntMap (hackage.haskell.org/package/cont...)

20.01.2025 02:43 — 👍 0    🔁 0    💬 1    📌 0
hashtables Mutable hash tables in the ST monad

hackage.haskell.org/package/hash...

17.01.2025 19:21 — 👍 4    🔁 0    💬 0    📌 0

Emacs lisp would be another example, though that language is uglier than scheme

17.01.2025 03:37 — 👍 1    🔁 0    💬 0    📌 0

GNU guix basically takes this to the logical extreme. It’s a whole OS that is configurable and scriptable in Scheme.

17.01.2025 03:35 — 👍 1    🔁 0    💬 1    📌 0

There is mutation via set! in Scheme but it’s easily avoidable and not idiomatic.

But otherwise it seems to meet your criteria. Easy to parse, human-readable, embeddable, interpretable.

17.01.2025 03:34 — 👍 1    🔁 0    💬 2    📌 0

Is this just Scheme?

17.01.2025 03:11 — 👍 1    🔁 0    💬 1    📌 0

(Or replace unit with the fields of the type you’re creating)

10.01.2025 22:32 — 👍 1    🔁 0    💬 0    📌 0

It’s annoying, but can be alleviated by following the pattern of wrapping *all* types in a module, and then exposing a function create : unit -> t from that module.

Particularly important for record types because otherwise type inference sucks ass

10.01.2025 22:31 — 👍 1    🔁 0    💬 2    📌 0

For all the excitement about RAG in the LLM space, enriching the context of code generation with static analysis (whether it be something like control-flow or typechecking) oddly seems to be relatively unexplored so far.

30.12.2024 19:56 — 👍 0    🔁 0    💬 1    📌 0

I didn't realize until recently that iCloud lets you use a custom domain for email for $1/month. Good stuff. Compare that to $6/month for 1 user on Google workspace for a custom domain on gmail.

30.12.2024 16:22 — 👍 1    🔁 0    💬 0    📌 0

Yikes. Somehow one of the only language tooling this makes more sense for 🙃

28.12.2024 13:33 — 👍 1    🔁 0    💬 0    📌 0

I’m assuming Haskell? Are you using different ghc versions for the LSP and cabal/stack?

28.12.2024 13:30 — 👍 0    🔁 0    💬 1    📌 1
Post image Post image

Day 5 #AdventOfCode

21.12.2024 22:38 — 👍 2    🔁 0    💬 0    📌 0
Post image Post image

I'm a little behind now, but here's day 4! #AdventOfCode

21.12.2024 19:26 — 👍 1    🔁 0    💬 1    📌 0

I’ve thought a bit about syntax sugar that turned method syntax into module qualified syntax. In OCaml terms, suppose it was required that every module exposed a type t.

Then you could have lst : t and turn lst.map(f) into List.map(lst, f)

Basically UFCS but with a standard module structure

12.12.2024 18:47 — 👍 1    🔁 0    💬 0    📌 0

No it doesn’t. My comment wasn’t very clear but I meant that since you don’t need to create a new file to created a namespaced modules in OCaml, it’s easier to avoid circular imports by just putting code that uses the same types in the same file (but still different modules)

08.12.2024 15:40 — 👍 2    🔁 0    💬 0    📌 0

I admit it’s ugly but I have done in Haskell to avoid cyclic imports, mainly when I wanted to annotate functions using the same types but otherwise separate functionality into separate files. It’s part of why I much prefer OCamls modules.

07.12.2024 22:17 — 👍 3    🔁 0    💬 1    📌 0
Preview
Merge wasm_of_ocaml by OlivierNicole · Pull Request #1724 · ocsigen/js_of_ocaml This aims to merge wasm_of_ocaml, currently hosted at https://github.com/ocaml-wasm/wasm_of_ocaml, back into this repo. This is pending on Dune support ocaml/dune#11029. For now, Dune is pinned for...

wasm_of_ocaml (a compiler of OCaml to WASM, and a fork of the JS compiler js_of_ocaml) has been merged. Congrats to all that contributed!

github.com/ocsigen/js_o...

05.12.2024 16:06 — 👍 18    🔁 3    💬 0    📌 0

The real tragedy of missing the Lowe Post is I haven’t gotten to hear the Thibs impression

05.12.2024 00:45 — 👍 1    🔁 0    💬 0    📌 0
Post image

Day 3 #AdventOfCode

04.12.2024 02:30 — 👍 2    🔁 0    💬 1    📌 0
Preview
Bicameral, Not Homoiconic Parenthetically Speaking: Articles by Shriram Krishnamurthi

Sometimes it takes me 22 years (+ one evening) to write a blog post. Here are my thoughts on "homoiconicity" and, as an alternative, "bicameral syntax". (Warning: 4000 words.)
parentheticallyspeaking.org/articles/bic...

02.12.2024 03:19 — 👍 140    🔁 40    💬 24    📌 11

I've been waiting for this since @lexi-lambda.bsky.social launched her own campaign against homoiconic a while ago

03.12.2024 19:06 — 👍 1    🔁 0    💬 1    📌 0
Post image

Day 2 #AdventOfCode

Racket should have reduce in racket/list !

03.12.2024 03:30 — 👍 0    🔁 0    💬 1    📌 0
#lang racket/base

(require racket/port)
(require racket/string)
(require racket/list)
(require racket/hash)

(define (parse filename)
  (define lines (port->lines (open-input-file filename) #:close? #t))
  (define input-pairs
    (for/list ([line lines])
      (map string->number (string-split line "   "))))
  (define left (map car input-pairs))
  (define right (map cadr input-pairs))
  (values left right))

(define (solve-part-1 left right)
  (define left-sorted (sort left <=))
  (define right-sorted (sort right <=))
  (apply + (map abs (map - left-sorted right-sorted))))

(define (solve-part-2 left right)
  (define right-appearances (make-hash))
  (for ([x right])
    (hash-update! right-appearances x add1 0))
  (define similarity-scores
    (for/list ([x left])
      (* x (hash-ref right-appearances x 0))))
  (apply + similarity-scores))

(define-values (left right) (parse "input.txt"))
(solve-part-1 left right)
(solve-part-2 left right)

#lang racket/base (require racket/port) (require racket/string) (require racket/list) (require racket/hash) (define (parse filename) (define lines (port->lines (open-input-file filename) #:close? #t)) (define input-pairs (for/list ([line lines]) (map string->number (string-split line " ")))) (define left (map car input-pairs)) (define right (map cadr input-pairs)) (values left right)) (define (solve-part-1 left right) (define left-sorted (sort left <=)) (define right-sorted (sort right <=)) (apply + (map abs (map - left-sorted right-sorted)))) (define (solve-part-2 left right) (define right-appearances (make-hash)) (for ([x right]) (hash-update! right-appearances x add1 0)) (define similarity-scores (for/list ([x left]) (* x (hash-ref right-appearances x 0)))) (apply + similarity-scores)) (define-values (left right) (parse "input.txt")) (solve-part-1 left right) (solve-part-2 left right)

Day 1 #AdventOfCode

03.12.2024 03:24 — 👍 0    🔁 0    💬 1    📌 0
Preview
GitHub - micahcantor/advent-of-code-2024 Contribute to micahcantor/advent-of-code-2024 development by creating an account on GitHub.

Doing Advent of Code this year in Racket. I may not finish them all, but should be fun!

github.com/micahcantor/...

03.12.2024 03:23 — 👍 3    🔁 0    💬 1    📌 0

@micahcantor is following 19 prominent accounts