Top
Best
New

Posted by v0id_isgood 18 hours ago

Show HN: Wyzer Programming Language(github.com)
So i've been working on this project since a few days (or months i should say), it's called wyzer (meaning wiser) it's a statically typed, compiled, resource-oriented programming language with integrated distributed safety via choreographic programming and perceus memory model, The reason why i began this project is out of frustration from Rust, you see it does provide safety for your memory by the strict type checking but what it does not gurantee safety against are distributed deadlocks which is basically a few independent nodes or services wait permanently for resources or messages held by each other, forming a circular wait, the rest are cross-service correctness and protocol mismatch as well. If we are specific over here Wyzer works on mainly generalizing the concept of choreographic programming in a high level programming language because its the very few attempts of actually solving these gaps of safety. Instead of borrow checkers and lifetimes wyzer has linear/affine types and a perceus reference counting which is computationally much simpler for an LSP to understand as well

after 5 months of research and a few weeks of development i am soon going to release version 0.1.0 of it, if you would like to contribute to it you're most welcome!

187 points | 105 commentspage 3
pron 14 hours ago|
> Go, Java, C#, and Python use garbage collectors. This makes them easier to use but slower and less predictable.

It does not. The term "garbage collectors" covers a whole spectrum of algorithms, some might slow you down (though not for the reason you may think) while others were invented to speed up memory management beyond that of C++, in exchange for other tradeoffs. Python's (mostly) refcounting GC is actually closer to C in its memory management overhead than to either Go or Java. It's also not what makes Python slow. Go uses a mark-and-sweep collector to find a balanace between speed, FFI, and footprint. Java uses moving collectors, which are faster - and some of which are even more predictable - than memory management in C++. That's because Java aims to offer better performance than C++ in large concurrent software, where low-level languages tend to suffer from various overheads due to their requirement for low-level control (Java trades off some performance in smaller programs, but mostly it trades of startup time and footprint). Moving collectors (but not refcoting collectors or mark-and-sweep collectors) are an optimisation over free-list approaches, not a compromise for convenience.

So it is true that slow programming languages tend to use some kind of GC, but that's not what makes them slow, nor does it make the super-fast languages that also use a GC (often of a very different kind) any slower. The range of languages that use GCs covers everything from the super slow to the super fast.

jesse__ 8 hours ago||
I don't understand how you can claim that using a GC does not make a language slower and less predictable.

Running a GC takes time, pollutes the cache, and is often run at an unpredictable time. Sure, the GC is not necessarily the SLOWEST thing about the language (python), but it's not helping, either.

pron 7 hours ago|||
> Running a GC takes time

Yes, but for a moving collector that's less time than it takes to run malloc and free. The interaction of a moving collector with most object is bump allocation when they're allocated (similar to stack allocation) and... that's it. The GC never sees them again, scans them again, or is even aware of their existence (moving collectors don't have a free operation). Overall, moving collectors (but not other kinds of GC) reduce the work of memory management compared to malloc/free.

In low-level languages we try to avoid doing a lot of malloc/free not because heap memory management is slow in general, but because that approach to memory management is slow. Moving collectors are an optimisation designed to make heap memory management fast, but it requires that (nearly) all pointers be movable, something that low-level languages can't do because they have constraints that are more important to them than speed (you can't interact with the OS or hardware directly, i.e. without an FFI API, if your pointers are movable, and such direct interaction is the point of low-level languages).

That moving collectors (NOT the GC Python has; NOT the GC Go has) can, in principle, make heap memory management cheaper than stack allocation has been well known since the eighties. But until recently they had excellent throughput (somewhat similar to arenas) but potentially long pauses. It was only recently that they were made "pauseless".

> and is often run at an unpredictable time

How much work malloc and free need to do is also unpredictable, and a modern pauseless moving collector like ZGC spreads the work needed for memory management more evenly than malloc and free.

> Sure, the GC is not necessarily the SLOWEST thing about the language (python), but it's not helping, either.

There is very little resemblance between CPython's GC and Java. Python's memory management is closer to C's than to Java's. GCs cover such a wide spectrum of algorithms that it doesn't make sense to talk about them as a single category as far as performance tradeoffs are concerned.

xigoi 7 hours ago|||
> Running a GC takes time, pollutes the cache, and is often run at an unpredictable time.

Isn’t this only the case for tracing garbage collectors? (And even then, not all of them are stop-the-world.)

allknowingfrog 12 hours ago||
The quoted text says "slower". It does not claim that GC makes those languages slow overall.

Are you arguing that GC is not inherently slower than other memory management strategies (e.g. the Rust approach)? Or just that the cost is not worth optimizing away?

pron 6 hours ago||
Of course GC is not inherently slower than other memory management strategies. Not only because GC is not a "memory management strategy" but a wide spectrum of them, but also because some GCs are used to speed up memory management compared to low-level languages. Dynamic heap allocations in low-level languages is often minimised because it is slow; some GCs are used to solve this problem.
srean 12 hours ago||
Could one compare choreography with this model

https://felix-tutorial.readthedocs.io/en/latest/intro_corout...

Note this is for cooperative threading.

NetMageSCW 8 hours ago||
So variables are declared with var, constants are declared with const or with let unless it is let mut which isn’t described? I stopped right there.
netniuq 15 hours ago||
nice Rust-inspired syntax, although if the main selling point is choreography here, that isn't featured enough on web page or README. Needs more examples/explanation of how that works.

Promising insofar as all of the essentials seem to be right (for me): compiled, good type checker, no garbage checker etc.

andai 15 hours ago||
Very interesting. Maybe this would benefit from concrete examples, of things that are difficult or impossible in other languages, but well supported in Wyzer? I see there's a few high level examples, but I'm thinking concrete scenarios with code snippets might be helpful.
bryzaguy 13 hours ago||
This looks cool! Memory safety beyond Rust with simpler code is a strong claim. Something I'd love to see is examples that mimic issues Rust borrow checker would catch as well as ones only wyzer would catch.
adastra22 12 hours ago||
I skimmed so I may have missed it, but nowhere in the README do I actually see a description of what "choreographic programming" is, or an example of it.
pmarreck 15 hours ago||
> prentensious quote

It's "pretentious."

(said pretentiously, lol)

Hey, at least we know AI didn't write it, lol

tosti 13 hours ago|
I'm guessing it refers to this paper:

https://www.microsoft.com/en-us/research/wp-content/uploads/...

(wait what is that WordPress?)

pmkary 13 hours ago||
The fact that the author is 14 years old makes my day. Nice work!
beckford 11 hours ago|
Awesome! How did you find that out?
pmkary 11 hours ago||
It was written in the GitHub bio.
lostbean 12 hours ago|
This is very exciting! Curious to learn more about how the linear types fits into the picture here?
More comments...