Hacker News new | past | comments | ask | show | jobs | submit login

What makes this a "systems programming language", especially since it has "no pointers or references"?



Indeed, that makes it not a systems language by any definition I am familiar with.

> Reasonable C interop, and probably, initial compilation to C.

How do you achieve "reasonable C interop" without pointers, I wonder?


You cast integers to pointers and play with fire, of course!


Void*? Int. Char**? Also an Int. I take it back. This is true systems programming - the same type safety that raw assembly is known for.


Ironically Assembly is safer than C and languages that descend from it, because although CPUs might have undefined behaviour when given undocumented opcodes, or operation modes, the CPU doesn't rewrite your code without telling you about it.


That's "safer" only against a very specific and limited set of dangers. But it opens the door to other dangers.


Yes it is. Great comment.


Naturally with PEEK and POKE.


I wonder the same, but aren't pointers just integers?

So if you store a memory address in the integer variable X, you just need a way to access that memory.

In assembly languages, usually, you have no pointers.


Interestingly although all of C's other types are in fact just the machine integers wearing funny hats (e.g. char is just either a signed or unsigned byte depending on platform, float is just the 32-bit unsigned integers as binary fractions) the pointers are not actually just integers.

They could be, but it's much worse from a performance perspective if you just have these raw machine addresses rather than the pointers in the C language so actual C compilers haven't done that for many years. ISO/IEC TS 6010 describes the best current attempt to come up with coherent semantics for these pointers, or here's a Rustier perspective https://www.ralfj.de/blog/2020/12/14/provenance.html [today Rust specifically says its pointers have provenance and what that means, like that TS for the C language]

Now, if you read Ralf's post and want to argue about that I'm afraid there are already lots of HN discussions and your point has probably already been made so: https://news.ycombinator.com/item?id=25419740 or https://news.ycombinator.com/item?id=42878450


> float is just the 32-bit unsigned integers as binary fractions

Note that float and double are a bit particular because they can use different registers! But yeah, when stored in memory they are the same 32/63 bit integers.


Like we did in BASIC, with PEEK and POKE, just have to keep track what those numbers are for.


The term was introduced so long ago, it's basically prehistoric now. Pointers are needed only for system programming language, they can be absent in systems programming language.


  int ptr




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: