logoalt Hacker News

G Lang – A lightweight interpreter written in D (2.4MB)

34 pointsby pouyathelast Friday at 1:56 PM7 commentsview on HN

Hi HN,

I've been working on a programming language called G. It is designed to be memory-safe and extremely fast, with a focus on a tiny footprint.

The entire interpreter is written in D and weighs in at only 2.4MB. I built it because I wanted a modern scripting language that feels lightweight but has the safety of a high-level language.

Key Features:

     Small: The binary is ~2.4MB.
     Fast: Optimized for x86_64.
     Safe: Memory-safe execution.
     Std Lib: Includes std.echo, std.newline, etc.
     
GitHub: https://github.com/pouyathe/glang

I would love to get some feedback on the syntax or the architecture from the community!


Comments

pouyathelast Sunday at 6:42 PM

    "Update: Wow, this got a second life! Seeing a spike in GitHub clones (328+ in 2 days). If anyone's trying G, I'd love to hear:

        What's your use case?

        What's the biggest hurdle you faced?

        What feature would make G actually useful for you?

    Thanks for checking it out! — A 17yo student building this."
show 1 reply
olivia-bankstoday at 4:51 AM

I think this is a really cool project! The syntax here is interesting. I was wondering if you could shed some light on it, I wasn't able to find what `[@] : ` or `[%] : ` meant.

Also, can I ask why the source code for the interpreter looks like that? This is an honest question. I thought it might have been machine generated (via a sort of self-hosting G transpiler) but the comments at the top dissuade me from this view.

Panzerschrektoday at 5:57 AM

Do you have anything real to show? Do you have already a working memory safety mechanism?

veqqtoday at 7:26 AM

Check out Janet!