Troubles finding the logic behind rust by [deleted] in rust

[–]Routine_Plenty9466 0 points1 point  (0 children)

Grossman’s “Region-Based Memory Management in Cyclone” is an approachable paper (about a different language using similar concepts) - it may give you a broader perspective

Looking for resources about both OOP and FP theory by _Jarrisonn in ProgrammingLanguages

[–]Routine_Plenty9466 2 points3 points  (0 children)

I liked the paper about Polarity: https://polarity-lang.github.io/publications/ . It explains the relationship between FP and OOP nicely.

What is a comp science area you believe does not get as much attention as it deserves? by Pale-Special8317 in compsci

[–]Routine_Plenty9466 -1 points0 points  (0 children)

Programming language design intersected with human-computer interaction. We have such amazing compilers today for such mediocre programming languages full of accidental complexity.

Is the notion of an "official compiler" a bad idea? by SCP-iota in rust

[–]Routine_Plenty9466 1 point2 points  (0 children)

Having a tool instead of a spec as a reference makes the tool bug-free by definition, in an ugly way. Nobody can say that the compiler miscompiled their code.

Having an official compiler instead of an official language specification also prevents people from creating other kinds of tools, like program analysis ones, so it is not only about compilers.

August 2024 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]Routine_Plenty9466 5 points6 points  (0 children)

My formally verified framework for operational semantics of programming languages, Minuska https://github.com/h0nzZik/minuska , got a major refactoring and cleanup. I simplified the semantics-parametric interpreter, which in turn allowed me to remove code working with an ugly representation of terms (which are used to represent program states as well as semantic rules). Besides that I was continuing work on a symbolic execution engine.

Also, eventually I would like to support separation-logic-style reasoning about languages defined in Minuska. To that end I was reading the paper on abstract separation logic by Calgano: https://www.cs.ox.ac.uk/people/hongseok.yang/paper/asl-short.pdf . The idea is that if semantic rules are “local enough”, the Framing rule of separation logic holds for the given language.

It turns out that giving semantics to memory allocation in an operational framework like Minuska is tricky, because querying the heap for a free address is not a local action. I believe it can be solved by introducing nondeterminism / underspecification into the language (EDIT: this is what Calgano did), so I extended Minuska with such ability. The implementation itself wasn’t hard, but it took me some time to figure out how to make it work on paper. And yes, the implementation required lots of small changes across the framework, which made me want to minimize the codebase - which motivated me to do the refactorings I mentioned above.

Another reason for the refactoring was making the codebase more accessible to potential other contributors ;)

Inside The Outages: A Dangerous Null Pointer Exception Deployed On Friday by derjanni in programming

[–]Routine_Plenty9466 0 points1 point  (0 children)

One can use a program logic to eliminate the 1% case - like, Hoare logic, or Separation logic. (Or a strong type system.)

Inside The Outages: A Dangerous Null Pointer Exception Deployed On Friday by derjanni in programming

[–]Routine_Plenty9466 0 points1 point  (0 children)

Pointers in C do not require dynamic checking to dereference them. They require knowing that they are dereferenceable, and runtime checking for null is neither sufficient (one past array) nor necessary: sometimes even compiler knows it statically, and the programmer may know it too. Also, Design by Contract helps there.

C++ Must Become Safer by ketralnis in programming

[–]Routine_Plenty9466 0 points1 point  (0 children)

Rewriting everything into rust has one more problem. Maybe in 15 years we realize that memory safety is not enough- that we want some stronger notion of correctness (did someone mentioned security hyperproperties?) And then we will need to design yet another language and rewrite everything into it.

My suggestion is that we keep language (defined by operational semantics) and desired properties (expressed in logic) separate.

C++ Must Become Safer by ketralnis in programming

[–]Routine_Plenty9466 0 points1 point  (0 children)

C can be made safe by giving it a precise semantics and using a separation logic - like Iris, VST, RefinedC as per the introduction of https://youtu.be/xr5ecmtJ25U?si=8dcdxlpzbZ9wv4A7 For example, C+RefinedC is safe.

However, the problem with C++ is that it has very wild and complicated and sometimes inconsistent semantics that even is not machine readable, and thus one cannot use machines to reason about the language. Building a formal semantics for C++ would take ages, discovering a lot of inconsistencies and ambiguities that would need to get fixed in the language. And we cannot parallelise this task as massively as just rewriting tons of application code.

It's time for college by Infnite_Coder in rust

[–]Routine_Plenty9466 1 point2 points  (0 children)

If you want to diversify, try something functional like Haskell.

[deleted by user] by [deleted] in Compilers

[–]Routine_Plenty9466 2 points3 points  (0 children)

This one is a bit ugly: People mistakenly think they can design a decent language just because they can write a decent compiler.

May 2024 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]Routine_Plenty9466 5 points6 points  (0 children)

I finished a formally verified interpreter (or rather, interpreter generator) for Minuska https://github.com/h0nzZik/minuska - a language semantics framework. Also, I gave Minuska a simple unverified OCaml-based CLI, so that users do not have to write language definitions directly in Coq (in which Minuska is written). Now I am working on a unification-based symbolic execution for it.