
Show HN: Silk, a simple systems programming language - ajay-tatachar
https://ajaymt.github.io/silk/
======
ajay-tatachar
Hi HN! Silk is a project I began working on approximately six months ago
without any prior experience or knowledge of compiler design, and it's been a
frustrating but fun learning experience. It is very much a work in progress,
but I would love to hear feedback of any kind!

~~~
myu701
I'm sorry to say I'm not the target audience for this (I've done a grand total
of 7 paragraphs of K & R C, everything else is JIT or otherwise high level).

I will say it looks to have much nicer syntax than C without losing the ALGOL
family feel.

Why have the type after the name if I might ask?

------
supercasio
Congratulations, looks like a really nice language.

One nitpick: I think "val" looks too much like "var" and this will make it
harder do differentiate them by code skimming. I suggest changing "val" to
something like "const", or "fix", or "imm"...

~~~
conradludgate
I find it interesting how there's so many ways now of describing mutable vs
immutable.

Rust: let vs let mut Swift: let vs var Js: const vs let Silk: val vs var

I honestly get confused now. I started a new job working in go and I keep
writing let everywhere

~~~
zelphirkalt
The only one of those, that does not indicate by name to me, that it is about
mutability, is the on of Swift. I guess you could argue, that in math, when
someone says "let x be 2", then x is constant. In the context of programming
though, I am more familiar with the var and let in JS, which is not at all
about mutability.

------
SeekingMeaning
I really love the syntax, especially the dereference operator being the _@_
symbol and the usage of _val_ vs _var_ for constants/variables. (For context,
I started off with Java and prefer writing in Kotlin nowadays.) Compared to
languages like Zig or V, I think you strike a pretty good balance between
being familiar and introducing new/different syntax.

~~~
maxmcd
Just curious: why might @ be preferred over &?

~~~
conradludgate
& isn't even the dereference operator, right? That's what gives you the
pointer. * gives you the value at the pointer. I guess that's why it's
preferable, in English it reads nicely and describes exactly what it does.
`val arg = @(argv + 1)` reads like "val arg is the value at argv + 1"

~~~
miccah
I always read & as "at" mentally when reading code :)

~~~
2OEH8eoCRo0
I read it as "address of" but @ definitely works if we are talking about an
address. The value is @x

------
robmccoll
Nice work - also there is a slight name collision with the now-defunct Cilk
family of programming languages
[https://en.wikipedia.org/wiki/Cilk](https://en.wikipedia.org/wiki/Cilk)

------
nielsbot
Would be nice to make the statement-ending semicolons optional. Like Swift,
shell languages, JS (sorta), and more... I have moved to Swift from Obj-C, and
this is one of my favorite things about Swift syntax.

