Live data from Hacker News

Ark – A modern systems programming language

ark-lang.org

41–50 of 55 posts

Re: Ark – A modern systems programming language

#41
post #38
post #26

Could this be used for embedded development? Currently C is used pretty much universally for this purpose. While C is better than straight assembler, it seems to be very prone for bugs, especially when there are multiple developers and over time in maintenance phase. Something safer is desperately needed for embedded firmware development. Lack of such a language is already affecting physical safety of end user device…

I think that Nim satisfies many of the items on your list. Have you taken a look at it? Specifically, it's a very good C replacement as it compiles to C. So you can easily run it on all of those embedded architectures. While I must admit that it leans towards using a GC for memory safety, you can disable it and use Nim as a more readable C easily. If you're brave you can attempt to use Nim's GC in embedded hardware t…

Yeah, Nim is one of the languages I'm interested in.

> Specifically, it's a very good C replacement as it compiles to C. So you can easily run it on all of those embedded architectures.

Yes, this is indeed a huge plus for this application.

>If you're brave you can attempt to use Nim's GC in embedded hardware too, it's very flexible.

I'm not going to be that brave. :)

> If you want statically guaranteed memory safety then do check out Rust, I'm assuming you already have though and dismissed it for some reason.

Static guarantees are good, less code and checking at runtime. I haven't dismissed Rust in any way. One huge bonus point for Rust is that it has a major organization, Mozilla, behind it. Of course, the fact that Mozilla is primarily interested to develop a web browser can be a liability. In the future, Rust might take a path that's less suitable for embedded firmware.

Re: Ark – A modern systems programming language

#42

I don't understand how a language can be a year old and have 3000 commits, but have so few tests in its implementation. That is an instant red flag for me.

It started off as a side project by myself, I'm a student so I work on it every now and then, but I'm 17 so I have bigger things to prioritise like my education. The large commit count is due to a certain someone cough Vedant cough making several accounts and doubling the commit history when he re-authors his commits.

The fact that it's a year old is because the language has changed loads in the past, since I considered it a side-project that I would just play around with. However, after I stuck to something, it gained a bit more popularity and people started to help me out with it. Now we have ported to Go, with a decent sized team working on it (when we can).

Re: Ark – A modern systems programming language

#43

Here the example on the site: func main(): int { mut i := 0; for i I'm really curious about 2 things: that for seems to really be a while . Why := in the declare and = in the assignment?

Hi, for is basically a while loop yes. We haven't implemented ranges yet, so this is the example we chose since it works, and it's fairly concise to fit on the website.

I chose `:=` and `=` mostly because of personal preference.

Re: Ark – A modern systems programming language

#44

Earlier quoted context omitted.

Perhaps the author was inspired by the Go language, as those are both Go-isms: Go's only loop is a for loop, and := tells the compiler to infer the variable type when initializing. In fact, this snippet is only a few deviations away from being valid Go code.

Their compiler is written in Go. See https://github.com/ark-lang/ark

You also need to remember that at one point Go's compiler was written in C, as with rust. It's all apart of the language evolution.

Re: Ark – A modern systems programming language

#45
post #2

If all this is Rust with the syntax of go, aw heck that's all I ever wanted anyway.

It doesn't look like it's memory safe.

Unlike Rust, this is something we aren't focusing on. I just really like Rust, so we borrowed a lot of the syntax.

Re: Ark – A modern systems programming language

#46
post #30

> Our goal is to write a systems programming language that adopts many modern concepts and advancements in the field of compilers and language design over the past 43 years. But they still kept = for assignent and the very ugly == for comparaison. Into the trash it goes.

I've never really found those a problem, I imagine this is more of a subjective thing.

Re: Ark – A modern systems programming language

#47

Earlier quoted context omitted.

It doesn't look like it's memory safe.

Unlike Rust, this is something we aren't focusing on. I just really like Rust, so we borrowed a lot of the syntax.

Yup, and that's a totally legitimate decision IMHO. Best of luck with your project :)

Re: Ark – A modern systems programming language

#48
post #35
post #33

Earlier quoted context omitted.

If you're willing to be stuck with a specific architecture(xcore by xmos) ,they offer their XC language and tools ,which are very good your requirements: a actor model like language for the xcore mcu. supports actors(paralell tasks with communication chnnels, pattern matching on "events", assigning actors to diffeent "cores"-hw threads, boundary checks on arrays, special pointers(aliased/restricted) with good error m…

Sounds very good and interesting. But vendor lock-in and architecture restriction is unacceptable. Embedded firmware development needs something that can be targeted to existing platforms.

Ah, OK.

BTW ,this guy[1] is already using/playing with rust for mcu's. maybe he found a way to make it work for ISR's ?

[1]http://spin.atomicobject.com/2015/05/21/generate-embedded-ru...

Re: Ark – A modern systems programming language

#49

I don't understand how a language can be a year old and have 3000 commits, but have so few tests in its implementation. That is an instant red flag for me.

It started off as a side project by myself, I'm a student so I work on it every now and then, but I'm 17 so I have bigger things to prioritise like my education. The large commit count is due to a certain someone cough Vedant cough making several accounts and doubling the commit history when he re-authors his commits. The fact that it's a year old is because the language has changed loads in the past, since I conside…

I recommend increasing the number of tests significantly, this is really important. A compiler is one of the easiest bits of software to test, so mastering good practice here will help you in the future.

It is impressive if you are only 17! Keep it up.

Re: Ark – A modern systems programming language

#50

Earlier quoted context omitted.

Their compiler is written in Go. See https://github.com/ark-lang/ark

You also need to remember that at one point Go's compiler was written in C, as with rust. It's all apart of the language evolution.

I'm not blaming them, just saying there's evidence the authors are quite familiar with Go. =P
Post reply on HN