Live data from Hacker News

The Om Programming Language

om-language.com

81–90 of 119 posts

Re: The Om Programming Language

#81
post #55

Earlier quoted context omitted.

I'm still waiting to see the first show HN I made a language designed for LLMs to write programs better.

A few days ago I asked Claude what kind of language it would like to program in, and it said something like Forth but with static typing, contracts, and constraint solving, implemented on the Erlang BEAM. So I have been prodding Claude Code for a few sessions to actually do it. It's a silly experiment, but fun to watch. Right now it's implementing a JSON parser in the generated language as a kind of milestone example…

If you don't mind, could you drop some code? I'd be interested to see the result :)

Re: The Om Programming Language

#83

Earlier quoted context omitted.

A few days ago I asked Claude what kind of language it would like to program in, and it said something like Forth but with static typing, contracts, and constraint solving, implemented on the Erlang BEAM. So I have been prodding Claude Code for a few sessions to actually do it. It's a silly experiment, but fun to watch. Right now it's implementing a JSON parser in the generated language as a kind of milestone example…

If you don't mind, could you drop some code? I'd be interested to see the result :)

sure, for example it generated this small demo of the type and contract safeguards. As you can see, it's mostly "Forth but with things":

  # bank.ax — The Safe Bank (Milestone 2)
  #
  # Demonstrates property-based verification of financial operations.
  # Each function has PRE/POST contracts. VERIFY auto-generates random
  # inputs, filters by PRE, runs the function, and checks POST holds.
  
  # DEPOSIT: add amount to balance
  # Stack: [amount, balance] (amount on top)
  # PRE: amount > 0 AND balance >= 0
  # POST: result >= 0
  DEF deposit : int int -> int
    PRE { OVER 0 GTE SWAP 0 GT AND }
    ADD
    POST DUP 0 GTE
  END
  
  # WITHDRAW: subtract amount from balance
  # Stack: [amount, balance] (amount on top)
  # PRE: amount > 0 AND balance >= amount
  # POST: result >= 0
  DEF withdraw : int int -> int
    PRE { OVER OVER GTE SWAP 0 GT AND }
    SUB
    POST DUP 0 GTE
  END
  
  # Verify both functions — 500 random tests each
  VERIFY deposit 500
  VERIFY withdraw 500
  
  # Prove both functions — mathematically, for ALL inputs
  PROVE deposit
  PROVE withdraw
  
  # Demo: manual operations
  1000 200 deposit SAY
  1000 300 withdraw SAY

Running it outputs:

  VERIFY deposit: OK — 500 tests passed (1056 skipped by PRE)
  VERIFY withdraw: OK — 500 tests passed (1606 skipped by PRE)
  PROVE deposit: PROVEN — POST holds for all inputs satisfying PRE
  PROVE withdraw: PROVEN — POST holds for all inputs satisfying PRE
  1200
  700

Re: The Om Programming Language

#84
post #79
post #74

Earlier quoted context omitted.

Alt opinion: syntax is the least important part of a programming language. I can't wait for the day someone invents one where it's defined entirely as an AST (with the S standing for Semantic). Just bring your own weird syntax. I guess Unison is the closest to this platonic ideal right now? https://github.com/unisonweb/unison/issues/499

I have an idea, maybe we could represent that AST as parenthesis.

Honestly, we can do better than LISPs.

Just use curly brackets and boom. LISP 3k.

You're welcome.

Re: The Om Programming Language

#85
post #79

Earlier quoted context omitted.

I have an idea, maybe we could represent that AST as parenthesis.

Honestly, we can do better than LISPs. Just use curly brackets and boom. LISP 3k. You're welcome.

It can even be used to represent serialized objects...

Re: The Om Programming Language

#86
post #55

Earlier quoted context omitted.

I'm still waiting to see the first show HN I made a language designed for LLMs to write programs better.

A few days ago I asked Claude what kind of language it would like to program in, and it said something like Forth but with static typing, contracts, and constraint solving, implemented on the Erlang BEAM. So I have been prodding Claude Code for a few sessions to actually do it. It's a silly experiment, but fun to watch. Right now it's implementing a JSON parser in the generated language as a kind of milestone example…

[dead]

Re: The Om Programming Language

#87
post #74
post #25

Would recommend placing example language syntax above the fold. Was tough to have to scroll halfway down the entire site to see any syntax. Nobody cares about the EBNF syntax until they have a feel for the language.

Alt opinion: syntax is the least important part of a programming language. I can't wait for the day someone invents one where it's defined entirely as an AST (with the S standing for Semantic). Just bring your own weird syntax. I guess Unison is the closest to this platonic ideal right now? https://github.com/unisonweb/unison/issues/499

Love this take! Unison is exactly this, and it's awesome!

Here's a quote from one of the creators:

> But here's the super cool thing about our language! Since we don't store your code in a text/source code representation, and instead as a typechecked AST, we have the freedom to change the surface syntax of the language very easily, which is something we've done several times in the past. We have this unique possibility that other languages don't have, in that we could have more than one "surface syntax" for the language. We could have our current syntax, but also a javascript-like syntax, or a python-like syntax.

https://news.ycombinator.com/item?id=46053304

Re: The Om Programming Language

#88

Aren't LLMs supposed to write machine code directly, no more programming languages at all, any day now? Joking aside, programming languages are a good mental exercise. Forth was my first language after assembly. Didn't like the stack juggling and ended up using its macro assembler more and more, it became something else, conventions over code I suppose, like what to keep in registers. Forth (and Unix) got the composa…

So instead of using programming languages designed specifically to effectively express algorithms and data structures, we are going to use natural language like English that is clearly not expressive enough for this? It’s like rewriting a paper about sheaf cohomology in plain English without any mathematical notation and expecting it to be accessible to everyone.

:) Not exactly. We'll use English to get a kinda description, then test and debug to make that functional, then cycling the functionality with users to nail down what is actually needed. Which won't be written down anywhere. Like before. Except with autocomplete that tries to predict a page or two of code at a time. Often pretty accurately.

Re: The Om Programming Language

#89
post #25

Would recommend placing example language syntax above the fold. Was tough to have to scroll halfway down the entire site to see any syntax. Nobody cares about the EBNF syntax until they have a feel for the language.

Last commit is from 2 years

Re: The Om Programming Language

#90
post #79
post #74

Earlier quoted context omitted.

Alt opinion: syntax is the least important part of a programming language. I can't wait for the day someone invents one where it's defined entirely as an AST (with the S standing for Semantic). Just bring your own weird syntax. I guess Unison is the closest to this platonic ideal right now? https://github.com/unisonweb/unison/issues/499

I have an idea, maybe we could represent that AST as parenthesis.

That's cool, but I might prefer semantic whitespace. Sure would be neat if we could both work with the same code in our preferred forms.
Post reply on HN