| ▲ | qalmakka 2 hours ago | ||||||||||||||||||||||||||||||||||||||||
I don't really agree with this. Having strong types and guardrails like in Haskell, Rust or OCaml helps _massively_ with LLMs because they get very clear messages back, and can express their logic using semantic types they can easily follow. Conversely, I've noticed that AIs (just like humans) tend to kind of lose the thread with very dynamic code | |||||||||||||||||||||||||||||||||||||||||
| ▲ | nylonstrung 2 hours ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||
I've found the same: strong types are disproportionately valuable in LLM coding vs human coding because they essentially function as context and the typechecker actively enforces correctness | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | sroerick an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
OCaml core + interpreted Lisp on top really feels like total enlightment, I have to say. The dynamic features you get with a full blown REPL are, in some specific cases, worth the trade off you get by losing the guardrails (which I call Rubber Baby Buggy Bumpers). You're right though - strong typing feels like a cheat code. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | pseudony an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
And I think this point is a poor as any made in the article. Last I attempted to write some smaller ocaml project I used LLMs for support (but wrote myself). They generally weren’t excellent. Honestly, types don’t help as much as people want them to. The LLM does best on popular languages, especially those whose use and feel is also mainstream. That is to say, pick a niche language like Odin, and it may incorrectly start to over-apply Go’isms - knowledge from one language bleeds into how it approaches others. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | unprovable an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
Absolutely this. Plus, LLMs are surprisingly adept (in my experience) at handling gnarly syntactic corners of most widespread strongly typed languages, esp. C++ and Rust. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | xlii an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
And there is a super power to it. It's possible to write the whole system only by defining the types. The "glue" can be sloppy but as long as it keeps on the edges the output is most often fine. Recently I'm on the fence about Rust vs OCaml (but plan to write about it soon) because I have ~700k LoC in Rust but my workflow starts to get seriously dragged down by compilation/tests in isolated worktrees. I recently also dab with Gluon (as embeddable type safe scripting) and rule-based-development for maximum code control/agents output leverage. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | sheepscreek an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
Yes! Maybe the current limitation is due to their limited context and frequent compaction. Where they can lose track of (abc-xyz A B) and what A and B need to be. I’m not sure if the Common Lisp compiler can be very helpful either, since it’s a dynamic language and A and B could be many different types (duck typing). Strong types are the way to go, at least for now. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | brabel an hour ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||
What the heck this thread is about, Common Lisp has types and you can use them in ways most strongly typed languages wouldn’t let you! They are basically expressions, which gives a lot of flexibility. It may not be always checked statically, but in practice SBCL does a great job at doing it or at least emitting warnings when it can’t prove the code will fail at runtime. Also if you really want Haskell types you can use Coalton, which is essentially Common Lisp with Haskell types, but lets you interop with Common Lisp seamlessly as Kotlin with Java. | |||||||||||||||||||||||||||||||||||||||||