HN user

ArtixFox

116 karma
Posts5
Comments89
View on HN

Only backend has been swapped out. The tests will be fast too yes.

There is no real need to add an interpreter. Having custom backend s means that while currently it is being used for debug, far in future it might be able to compete with llvm for speed.

Adding an interpreter would be useless as u would still need to write a custom backend.

The problem is llvms slowness for debug and release.

my bad for using the word "parse", "working with the language" is better to explain my intent, the language is minimal [unfortunately it follows llvm's semantics but its planned to change].

Comptime cannot affect runtime, it cannot do syscalls and cannot go on forever. Due to how limited it is, we can simply let it evaluate and then work with the code that is left.

It is still a better method than either writing text macros[which are also fine but are a pain to use] or using proc macros which can do syscalls and open up a whole new can of worms.

In languages that dont have any metaprogramming support, you must rely on some thing of a generator which is most probably not provided by the compiler vendor and verifying and trusting it is now the responsibility of the user.

Now you are left with things like template metaprogramming where higher and more complex techniques are not supported by the standard or any verification tools and you must trust the compiler to take the right decision regarding the code and having no tools support its verification.

Out of all the options for metaprogramming for a language that must also be verification friendly, comptime is probably one of the best solutions, if not the best.

Zig not being much different from C in this aspect is quite an unexpected compliment because of plethora of work done for its verification. Those same tools can be modified to be used for zig but you would not have to worry about much beyond logic and memory allocation verification [there exists a prototype for both].

it doesnt catch temporal memory errors, but what it offers currently is still better than most of its competitors [defer, explicit allocators, custom allocators with integrated support for valgrind and friends,etc].

Due to how easy to parse and work with the language is, we might see a boom of static analyzers for zig. There are some quite interesting demos that can even go beyond basic borrow checking and straight into refinement types.

Zig's integrated build system will make it easy to add these tools into any project. Or maybe the zig compiler itself will integrate it.

the future is quite hopeful for zig but it is probably not one that is restricted to just borrow checking. I personally think it can go beyond and slowly become what C+FramaC or Ada is now for the critical systems world.

I guess formal verification tools? That is the peak that even rust is trying to reach with creusot and friends. Ada has support for it using Spark subset [which can use why3 or have you write the proofs in coq] Frama-C exists for C. Astree exists for C++ but i dont think lone developers can access it. But it is used in Boeing.

Im pretty sure valgrind and friends can be used in zig.

Zig is still not 1.0, theres not much stability guarantees, making something like Frama-C, even tho it is possible is simply going to be soo much pain due to constant breakages as compared to something like C.

But it is not impossible and there have been demos of refinement type checkers https://github.com/ityonemo/clr

Beyond that, tools like antithesis https://antithesis.com/ exist that can be used for checking bugs. [ I dont have any experience with it. ]

bruh, zig's VP called rust users safety coomers. Its internet shitposting who cares.

source: I was there when it happened and it was GLORIOUS.

Wait just 20% thats a low number damn. You said a lot and i was expecting...idk, 50%?

If Ada was used in domains where rust is used, like desktop applications, servers, high perf stuff, it would also do unsafe stuff you could never verify using spark.

But instead it is used in microcontrollers with runtimes provided by adacore and other vendors. Can you fully know if those pieces of code are 100% verified and safe? the free ones are not. atleast the free x86 one.

How ridiculous. The language you use is not memory safe btw. unchecked_deallocation can be easily used without any pragmas iirc. You need to enable spark_mode which will restrict you to an even smaller subset! You cannot even safely write a doubly linked list in it![you can with great pain in rust] [with less pain in Frama-C] [never tried ats]

you said you use Ada, if you use it, you should know that Ada is fundamentally unsafe language with a safe subset called spark.

It could not verify dynamic allocations thats why it has such a huge toolset for working with static allocations.

Frama-C allows you to program in a safe subset of the unsafe language called C.

And these languages are the backbone of everything where lives are at risk. YOu can have a language that allows both unsafe and safe.

Safety is not binary and our trains run C/C++ [BOTH UNSAFE LANGUAGES]

Common Lisp is an amalgamation of every lisp they could find, they slammed it all in. Calling it well designed is funny because every single CL developer openly accepts that its a fucking weird language with hell lot of warts that cannot be polished away.

Ada is fine, just verbose, kinda fun, no comments about it except that its kinda sad how weak their formal verification is. I prefer Frama-C over it. You can compare Ada and rust but ada is horrible, sincerely horrible at working with ownership. Frama-C can run laps around it as you can verify EVEN arbitrary pointer arithmetic.

Calling rust a horrible abomination is weird. As someone who dabbled in CL for an year, I love the fact that it has proc macros and even tho its harder to use it, i can make my own DSLs and make buildtime compilers!!

That opens up a world of possibilities.We can actually have safer and stricter math libraries! Maybe put us back in era of non-electron applications?

The horrible part might be syntax but eh, its a stupid thing to care about.

No? In india 2019, there was a terrorist attack where the jihadist organisation jaish-e-mohammad blew up a bus carrying soldiers via ramming a car filled with IEDs into the bus killing 40 people. In response, india did the balakot airstrikes, killing ~300 terrorists in a training camp [identified via the number of phones that were working in the area that was bombed.]

300 is clearly a bigger number than 40, so was the attack wrong? india used it as an excuse to kill more people than what should be considered a good proportional response!

Since that attack[and other operations], JeM and others became fairly inactive and terrorist attacks have gone down by an insane number, what used to be a daily occurrence and a reason to not attend local festival celebrations due to threat of bombs is now a rarity.

Proportionality has nothing to do with defence. Why on earth would u kill only a few terrorists as a response? Israels actions are fucked up but proportionality does not apply to defence. If a state is retaliating to a threat, why would it leave the threat alive, which would only cost lives of more of its people?

Israel's airstrike policy is bad and roof knocking is not enough, the way israel conducts war is wrong and there needs to be intervention that is able to chain israel while eliminating hamas, demilitarising palestinian jihadist groups and stabilising the region.

But proportionality has nothing to do with defence. you can be disproportional if that means the threat ceases to exist.

With C, you are not 100% sure that ur code will work. You have to verify and extensively test it. With C++ you have some very vague guarantees about ur code but you can easily transition from C and even have some interesting type safety like mp-units. with Rust, you have some good guarantees that ur code wont have UAF, will be threadsafe, etc etc and you can probably invent some interesting typesafety like mp-units.

In all 3, you gotta verify [frama-C, astree,bedrock, the many projects working on rust, esp the coq one] and extensively test it.

But by default, all 3 provide a different level of gurantees

yes, better airstrike policy as a first. Eliminating hamas is important, but instead of letting israel run wild, deploy a coalition so that you can chain israel while also eliminating hamas.

Self defense is not seen based on how many skulls you collected. Hamas needs to go and that's how Israel will do it's self defense.

Proportionality has nothing to do with self defense.

Hamas the org was involved, and the other ones too, they are the target.

But I do agree that Israel's policies regarding air strikes are fucked up

sooo prolong the problem so that when you are dead, your descendants have to deal with it and you will be free of the responsibility? Do we forgive oct 7? what precedent would it set for other groups? that you can just go kill and rape people and there will be no response?

sooo israel should use time travel? the situation right now is a fucked up war between two bloodthirsty groups. I dont think this is the right time to think of inventing time machines...

What is the other solution?

create a separate state for palestine under the control of hamas would only legitimise them, allow them to easily get more weapons and go on another oct 7, which will again lead to the bombings currently happening.

Bombing them to death would lead to deaths of many, many women and children cuz gaza is 75% children.

You cannot have peace with hamas, only ceasefire, and even then they havnt stopped launching homemade missiles.

The most sane solution is defeating hamas, establishing a third party control over it to stabilise the region and then return it to democracy, but israel is too trigger happy to do any progress on this field and hamas wants all of israel.

You cannot have peace on the land without destroying hamas. Not even for moral reasons. Maybe there is another solution in ur mind?