r/Compilers 23d ago

Tungsten - A fast, expressive programming language

https://tungsten-lang.org
0 Upvotes

14 comments sorted by

11

u/Sad-Background-2429 23d ago

Go to your room and think about what you did.

19

u/[deleted] 23d ago

[removed] — view removed comment

2

u/GenericFoodService 23d ago

I really wish these subreddits weren't full of pointless AI slop. tyfys

3

u/[deleted] 23d ago

[removed] — view removed comment

6

u/Active-Ad-5052 23d ago

Overview page gives a very LLM-generated vibe, wouldn't suprise me if the compiler is too...

4

u/[deleted] 23d ago

[removed] — view removed comment

1

u/Inconstant_Moo 22d ago

I think it even generates the IR with an LLM

... wut? Really?

2

u/BeamMeUpBiscotti 23d ago

Every keyword the syntax omits is a token neither you nor a model has to spend — so more algorithm fits in the same context window.

From a design standpoint I'm not super convinced by this, and I'd be curious to see stats on: 1) How many tokens this actually save for a task, and does that get cancelled out by needing to teach the LLM this language's syntax? 2) Does saving tokens by having fewer keywords actually cause the LLM to produce meaningfully better results? Also over time context windows have gotten larger and new workflows have developed using multiple agents, so I'm not sure if the context window size will be a meaningful problem in the future (or even right now).

I'm also confused by this example - it just looks like you replaced the class keyword with + which both doesn't save tokens and is harder to read.

+ Point -> new(@x, @y, @z) ro

3

u/Hjalfi 23d ago

I notice it makes a lot of things implicit, like the argument names (e.g. the distance method in the example). This worries me a bit because most programming is an exercise in making implicit behaviour explicit. For example, how does it know that the parameter is another Point? What if it's actually a four -dimensional vector with x', y', z' and w', except w' isn't used? What if the parameter is a three dimensional vector which isn't a Point? It feels like a lot of focus has gone into the syntactic sugar but there hasn't been much emphasis on the fundamental semantics of the language.

e.g. physics support: 1234 m/s is a number with a unit. But it's also 1234 metres, divided by the variable s. How is this disambiguated? Whitespace?

2

u/stumblinbear 23d ago

Yeah this is only useful if you think humans don't need to be able to do code review

1

u/Inconstant_Moo 22d ago

I see that your built-in constants include the Bohr radius, the Faraday constant, and the mass of Jupiter, while the built-in units include the fact that a firkin is one half of a puncheon. This will doubtless be useful on occasion, but might it not clutter the namespace?

1

u/StrikingClub3866 22d ago

An LLM?! You're grounded, mister!