News for hackers. Stuff that matters.
Re:Cello – High Level C by loeg on Saturday March 05, 2022 @02:19AM (#30565213)
Previously, previously, previously, previously, previously, ...

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

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

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

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

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

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

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

This shows up periodically and it looks pretty nightmarish (~15 years reading and writing C). If you want this kind of abstraction, I think you're better served by any of the dynamically-typed scripting languages.

Re:Cello – High Level C by fps-hero on Saturday March 05, 2022 @06:22AM (#30566479)
It is definitely worth pointing out that this isn’t new, the idea itself is truely fascinating and the author clearly articulates this is code as art. It is definitely eye opening once you read into the details.

I stumbled across this when a new chapter of crafting interpreters came out, and I ended up doing a deep dive into how to speed up CPython. My conclusion was that it wouldn’t be possible without rearchitecture of the fundamental types, and hence unpalatable, but a fun exercise none the lesser

If you’d be wrong to so quick to dismiss Cello. Cello is an order of magnitude quicker than python, even cython can only achieve 3x on CPython without annotation. The ideas behind Cello put it somewhere around JavaScript speed, but far more extendable, and definitely worthy of further investigation.

To expand further, fat pointers (void type, void data) could be superior to NaN boxing, and I’m not aware of any interpreted languages that have seriously implemented fat pointers, but it seems to be going well for Rust.

Re:Cello – High Level C by freemint on Saturday March 05, 2022 @08:17AM (#30567287)
> any interpreted languages that have seriously implemented fat pointers

Have a look at PicoLisp. It has less than a handful of data types but i uses "Tag Bits". Julia is not really interpreted but it uses pointer tags for union types to save on boxing?

Re:Cello – High Level C by cma on Saturday March 05, 2022 @01:07PM (#30570072)
Micropython uses pointer tags for small ints, maybe other things?
Re:Cello – High Level C by rurban on Saturday March 05, 2022 @02:29PM (#30571004)
everybody in performant interpreters uses tagged pointers. micropython got it from lua, which got it from lisps
Re:Cello – High Level C by girvo on Saturday March 05, 2022 @04:05AM (#30565816)
If you want this kind of abstraction while retaining some of the upsides of C, you’re better served with Nim or similar in my opinion
Re:Cello – High Level C by kimixa on Saturday March 05, 2022 @03:31AM (#30565618)
One of the advantages of a language is that you can get someone with experience in that language and they'll be able to understand it (with some work for code style and libraries used etc).

This seems to be different enough you may as well just use another language.