Top
Best
New

Posted by GeneralMaximus 4 hours ago

I built a programming language using Claude Code(ankursethi.com)
70 points | 90 commentspage 2
laweijfmvo 3 hours ago|
Using LLMs to invent new programming languages is a mystery to me. Who or what is going to use this? Presumably not the author.
matthews3 3 hours ago|
AI generate some feedback, then just move onto the next project, and repeat.
p0w3n3d 2 hours ago||
I'd say these times will be filled with a lot of tailored-to-you "self"-made software, but the question is, are we increasing amount of information in the world? I heard that claude and chatgpt are getting good at mathematical proofs which give really something to our knowledge, but all other things are neutral to entropy, if not decreasing. Strange time to live in, strange valuations and devaluations...
NuclearPM 16 minutes ago|
Neutral to entropy? What do you mean?
jaggederest 3 hours ago||
I think we're going to see a lot more of this. I've done a similar thing, hosting a toy language on haskell, and it was remarkably easy to get something useful and usable, in basically a weekend. If you keep the surface area small enough you can now make a fully fledged, compiled language for basically every single purpose you'd like, and coevolve the language, the code, and the compiler
marginalia_nu 3 hours ago||
Yeah it's a rewarding project. Getting a language that kinda works is surprisingly accessible. Though we must be mindful that this is still the "draw some circles" pane. Producing the rest of the rest of the famous owl is, as always, the hard bit.
soperj 3 hours ago|||
We did this in 4th year comp-sci.
Bnjoroge 2 hours ago||
Not to discount your experience, but I dont understand what's interesting about this. You could always build a programming language yourself, given enough time. Programming languages' constructs are well represented in the training dataset. I want someone to build something uniquely novel that's not actually in the dataset and i'll be impressed by CC.
jackby03 2 hours ago||
Curious how you handled context management as the project grew — did you end up with a single CLAUDE.md or something more structured? I've been thinking about this problem and working on a standard for it.
amelius 3 hours ago||
The AI age is calling for a language that is append-only, so we can write in a literate programming style and mix prompts with AI output, in a linear way.
geon 3 hours ago||
That’s git commits.
amelius 3 hours ago|||
That's arguably not very ergonomic, which is probably the biggest requirement for a programming language.
beepbooptheory 1 hour ago||
Why care about ergonomics if you're not going to write the code?
scottmf 3 hours ago|||
or css
koolala 3 hours ago||
A REPL + immutability?
grumpyprole 2 hours ago||
Does this really test Claude in a useful way? Is building a highly derivative programming language a useful use case? Claude has probably indexed all existing implementations of imperative dynamic languages and is basically spewing slop based on that vibe. Rather than super flexible, super unsafe languages, we need languages with guardrails, restrictions and expressive types, now more than ever. Maybe LLMs could help with that? I'm not sure, it would certainly need guidance from a human expert at every step.
atoav 2 hours ago||
I rolled a fair dice using ChatGPT.
righthand 3 hours ago||
> I’ve also been able to radically reduce my dependency on third-party libraries in my JavaScript and Python projects. I often use LLMs to generate small utility functions that previously required pulling in dependencies from NPM or PyPI.

This is such an interesting statement to me in the context of leftpad.

rpowers 3 hours ago|
I'm imagining the amount of energy required to power the datacenter so that we can produce isEven() utility methods.
righthand 2 hours ago|||
Also, neither over the wire dependency issues or code injection issues (the two major criticisms) are solved by using an llm to produce the code. Talk about shifting complexity. It would be better if every LSP had a general utility library generator built in.
nefarious_ends 3 hours ago|||
we need a caching layer
jcranmer 3 hours ago|
I recently tried using Claude to generate a lexer and parser for a language i was designing. As part of its first attempt, this was the code to parse a float literal:

  fn read_float_literal(&mut self) -> &'a str {
    let start = self.pos;
    while let Some(ch) = self.peek_char() {
      if ch.is_ascii_alphanumeric() || ch == '.' || ch == '+' || ch == '-' {
        self.advance_char();
      } else {
        break;
      }
    }
    &self.source[start..self.pos]
  }
Admittedly, I do have a very idiosyncratic definition of floating-point literal for my language (I have a variety of syntaxes for NaNs with payloads), but... that is not a usable definition of float literal.

At the end of the day, I threw out all of the code the AI generated and wrote it myself, because the AI struggled to produce code that was functional to spec, much less code that would allow me to easily extend it to other kinds of future operators that I knew I would need in the future.

dboreham 2 hours ago|
I had a somewhat experience with Claude coding an Occam parser but I just let it do it's thing and once I had presented it with a suitable suite of test source code, it course corrected, refactored and ended up with a reasonable solution. The journey was a bit different to an experienced human developer but the results much the same and perhaps 100X cheaper.
jcranmer 1 hour ago||
Some of the issues are undoubtedly that I have a decidedly non-standard architecture for my system that the AI refuses to acknowledge--it hallucinated things like integers, which isn't a part of my system, simply because what I have looks almost like a standard example expression grammar so clearly I must have all of the standard example expression grammar things. (This is a pretty common failure mode I've noticed in AI-based systems--when the thing you're looking for is very similar to a very notable, popular thing, AI systems tend to assume you mean the latter as opposed to the former.)
More comments...