top | item 30221722

(no title)

salimmadjd | 4 years ago

I totally agree on the syntax, Haskell is far cleaner.

I’m not sure what the reasoning was here. I hope the author or others can shed some light.

discuss

order

LightMachine|4 years ago

The reason for the syntax is that HVM aims to be a low level compile target, which sounds confusing because closures make it look very high level, but it should be seen as LLVM IR. It isn't meant for direct human use on the long term. Ideally it will be the compile target of languages like Haskell, Lean, Idris, Agda, Kind (my language) and others. As such, I just went for a syntax that simplifies and speeds up parsing, while still keeping it usable if you need to manually edit: there is no backtracking on this syntax.

conaclos|4 years ago

Is there some pages that compare Kind and Idris 2?

sfvisser|4 years ago

My guess is the author just picked the simplest syntax to parse in order to demonstrate the tech. If it works and shows to be successful you can always write a GHC (or whatever) backend that compiles to this runtime. Maybe come up with some binary IL etc

hexo|4 years ago

Or write self-hosting GHC backend that works like HVM does. That would be very neat.

For me, these projects (such as HVM) are great research stuff showing us how to do (or not do) things.

capableweb|4 years ago

> I’m not sure what the reasoning was here. I hope the author or others can shed some light.

From my point of view, the author almost made it into s-expressions, but decided not to go all the way, which (imo) would have been amazing and the "cleanest" (although I don't like using the term "clean" for code, it's so subjective). I'd like to have some light shed over the decision not to go all the way.

LightMachine|4 years ago

Changing it to pure s-expressions would be easy though, I guess just `let` isn't following that rule? I do love the no-parenthesis lets though.

klysm|4 years ago

Well we gotta have _some_ word for subjective quality.

fithisux|4 years ago

Not very knowledgeable, does it mean it can be a foundation for a Scheme compiler?