Live data from Hacker News

Show HN: GlyphLang – An AI-first programming language

news.ycombinator.com

1–10 of 30 posts

Show HN: GlyphLang – An AI-first programming language

#1
While working on a proof of concept project, I kept hitting Claude's token limit 30-60 minutes into their 5-hour sessions. The accumulating context from the codebase was eating through tokens fast. So I built a language designed to be generated by AI rather than written by humans.

GlyphLang

GlyphLang replaces verbose keywords with symbols that tokenize more efficiently:

  # Python
  @app.route('/users/')
  def get_user(id):
      user = db.query("SELECT * FROM users WHERE id = ?", id)
      return jsonify(user)

  # GlyphLang
  @ GET /users/:id {
    $ user = db.query("SELECT * FROM users WHERE id = ?", id)
    > user
  }

  @ = route, $ = variable, > = return. Initial benchmarks show ~45% fewer tokens than Python, ~63% fewer than Java.
In practice, that means more logic fits in context, and sessions stretch longer before hitting limits. The AI maintains a broader view of your codebase throughout.

Before anyone asks: no, this isn't APL with extra steps. APL, Perl, and Forth are symbol-heavy but optimized for mathematical notation, human terseness, or machine efficiency. GlyphLang is specifically optimized for how modern LLMs tokenize. It's designed to be generated by AI and reviewed by humans, not the other way around. That said, it's still readable enough to be written or tweaked if the occasion requires.

It's still a work in progress, but it's a usable language with a bytecode compiler, JIT, LSP, VS Code extension, PostgreSQL, WebSockets, async/await, generics.

Docs: https://glyphlang.dev/docs

GitHub: https://github.com/GlyphLang/GlyphLang

Re: Show HN: GlyphLang – An AI-first programming language

#4
I've found that short symbols cause collisions with other tokens in the llms vocabulary. It is generally much better to have long descriptive names for everything in a language than short ones.

An example that shocked me was using an xml translation of C for better vector search. The lack of curly braces made the model return much more relavent code than using anything else, including enriching the database with ctags.

>GlyphLang is specifically optimized for how modern LLMs tokenize.

This is extremely dubious. The vocabulary of tokens isn't conserved inside model families, let alone entirely different types of models. The only thing they are all good at is tokenizing English.

Re: Show HN: GlyphLang – An AI-first programming language

#5
post #2

Arguably, math notation and set theory already has everything that we need. For example see this prompt describing an app: https://textclip.sh/?ask=chatgpt#c=XZTNbts4EMfvfYqpc0kQWpsEc...

That's an awesome tool! I think textclip.sh solves a different problem though (correct me if I'm wrong - this is the first I've been exposed to it). Compression at the URL/transport layer helps with sharing prompts, but the token count still hits you once the text is decompressed and fed into the model. The LLM sees the full uncompressed text.

The approach with GlyphLang is to make the source code itself token-efficient. When an LLM reads something like `@ GET /users/:id { $ user = query(...) > user }`, that's what gets tokenized (not a decompressed version). The reduced tokenization persists throughout the context window for the entire session.

That said, I don't think they're mutually exclusive. You could use textclip.sh to share GlyphLang snippets and get both benefits.

Re: Show HN: GlyphLang – An AI-first programming language

#6
I think there’s a certain amount of novelty to this, and the aesthetic of the language I find pleasing, but I’m a little confused… Admittedly, I didn’t read the entire doc and only quickly glanced at the source… But is it just transpiling Golang code to and from this syntax, or is it intended to be a whole language eventually? Can folks able to just import golang packages or do they have to only use what packages are currently supported?

Additionally I have two thoughts about it:

1. I think this might be more practical as a transparent layer so users can write and get Golang (or whatever) the original language was back. Essentially making it something only the model reads/outputs.

2.) Longer term it seems like both NVidia and AMD along with the companies training/running the models are focused on driving down cost per token because it’s just too damn high. And I personally don’t see a world where AI becomes pervasive without a huge drop in cost token— it’s not sustainable for companies running the models and end users really can’t afford the real costs as they are today. My point being, will this even be necessary in a 12-18 months?

I could totally be missing things or lacking the vision of where this could go but I personally would worry that anything written with this has a very short shelf life.

That’s not to say it’s not useful in the meantime, or not a cool project, more so if there is a longer term vision for it, I think it would be worth calling out.

Re: Show HN: GlyphLang – An AI-first programming language

#7
I had a conversation with Claude about what language to work in. It was a web app and it led me to Typescript mainly because of the training data for the model, plus typing and being able to write pure functions. Haskell might have been preferred except for the lower amounts of training data.

Re: Show HN: GlyphLang – An AI-first programming language

#9
post #8

I feel like any deviation from the syntax LLMs are trained on is not productive. Sure you can represent the same code in fewer tokens but I doubt it'll get those tokens correct as often.

Yeah, big plus one from me. I recently tried to investigate some sort of alternative encoding to/from “the prompt,” and was swiftly told that was both not possible and would work against me. As you pointed out, the LLMs are trained on language and language itself is often not terse. Trying to skirt that will cause the LLM to calculate the vectors poorly because the relation between the input tokens and its training data doesn’t really exist.
Post reply on HN