Live data from Hacker News

Ark – A modern systems programming language

ark-lang.org

51–55 of 55 posts

Re: Ark – A modern systems programming language

#51
post #31
post #6

Earlier quoted context omitted.

Although some bits of syntax are reminiscent of Rust, semantically it's not Rust in the slightest: "Ark is not a garbage collected language, therefore when you allocate memory, you must free it after you are no longer using it. We felt that, as unsafe as it is to rely on the user to manage the memory being allocated, performance takes a higher precedence. Although garbage collection makes things fool-proof and remove…

Well, while I see the advantages of manual memory management as an embedded and kernel driver developer, one should understand manual memory allocation and freeing are very expensive and unpredictable operations . Very, very far from "zero overhead". There's usually no way you can afford to allocate memory while processing an interrupt request! It's simply too unpredictably slow. (Not to mention many synchronization…

For those who still think manual memory management and especially malloc and free are fast, check glibc implementation.

https://fossies.org/dox/glibc-2.21/malloc_8c_source.html#l02...

Also see this benchmark between different, faster allocators: http://locklessinc.com/benchmarks_allocator.shtml

The extra work doesn't end at allocation. When you actually implement a concurrent system, you'll usually end up having corner cases at object lifetime changes, which you need to synchronize. If the memory is only claimed when there are no more references to it, this extra synchronization step can be avoided. If you can't rely on this, you'll probably end up doing synchronization, such as (atomic) reference counting.

Synchronization is very expensive and it can quickly become the performance bottleneck for the whole system. On modern X86, you can do 5-20k floating point operations during one contended atomic sync op. Reference count increase or decrease is one sync op. A simple mutex needs two of those.

The more you have CPU cores, the more there will be synchronization (cache coherence) traffic broadcasted to all cores.

Words like "JIT" and "GC" seem to cause knee-jerk reactions in some developers. Likewise for manual memory management. It's not so black and white. There'll always be trade-offs. I usually write low level (firmware and kernel driver) and high performance code. C/C++/SIMD. Code that might need to react under a microsecond.

My message is just please be more open minded.

Analyze where your code spends its execution time. You might be surprised how much of it is spent in things like C++ streams, xprintfs and memory allocation. Unfortunately inter-core synchronization is more insidious. It's not visible in benchmarks on small systems. Often you only start to see hints of this problem when actually running on more cores. Enough of them, and that's all your code is doing.

Re: Ark – A modern systems programming language

#52

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…

So you're just 17. Heh. I've been working in this field for more than your age.

Keep up the good work, I can't wait with what you'll come up with later!

Goes to write some more bug prone C-based device driver code...

Re: Ark – A modern systems programming language

#53
post #20

Earlier quoted context omitted.

I really wish Rust was as great as you advocates say, but that has not been my experience. For background: I've been following it for a while now. About a year or so ago, I dove it into with enthusiasm, but I got bit when the sigils went away, and so I backed off until the 1.0 release. After the 1.0 release, I figured it was ready so I spent another couple of weeks learning the new way of things and really hoping tha…

Don't hold back! :) Criticism helps us improve, as long as you can make it constructive and make at least a cursory effort to understand Rust's goals. As I've said elsewhere, if memory safety isn't a priority for your product then Rust may not be for you. As for the lifetime annotations, we could be extending lifetime elision to more places, including to struct definitions, if people come up with rules that are easy…

I hate our current lifetime elision rules, as do many people who have been using Rust for a while. There was an RFC (which was closed) to add some back. IMO, the rules largely exist for the sake of making short examples look less threatening, rather than because they actually make Rust more usable.

Re: Ark – A modern systems programming language

#54
post #6

Earlier quoted context omitted.

Although some bits of syntax are reminiscent of Rust, semantically it's not Rust in the slightest: "Ark is not a garbage collected language, therefore when you allocate memory, you must free it after you are no longer using it. We felt that, as unsafe as it is to rely on the user to manage the memory being allocated, performance takes a higher precedence. Although garbage collection makes things fool-proof and remove…

I really wish Rust was as great as you advocates say, but that has not been my experience. For background: I've been following it for a while now. About a year or so ago, I dove it into with enthusiasm, but I got bit when the sigils went away, and so I backed off until the 1.0 release. After the 1.0 release, I figured it was ready so I spent another couple of weeks learning the new way of things and really hoping tha…

What is your opinion of D?

Do you think when the standard library is totally GC free it would be good for your use cases?

Re: Ark – A modern systems programming language

#55

Earlier quoted context omitted.

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.

lol, thanks will do :)
Post reply on HN