one-more-re-nightmare
zig
Our great sponsors
one-more-re-nightmare | zig | |
---|---|---|
11 | 808 | |
133 | 29,799 | |
1.5% | 4.5% | |
4.2 | 10.0 | |
9 months ago | about 13 hours ago | |
Common Lisp | Zig | |
BSD 2-clause "Simplified" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
one-more-re-nightmare
-
When a young programmer who has been using C for several years is convinced that C is the best possible programming language and that people who don't prefer it just haven't use it enough, what is the best argument for Lisp vs C, given that they're already convinced in favor of C?
One trick is that Common Lisp can generate and compile code at runtime, whereas static languages typically do not have a compiler available at runtime. This lets you make your own lazy person's JIT/staged compiler, which is useful if some part of the problem is not known at compile-time. Such an approach has been used at least for array munging, type munging and regular expression munging.
-
Tutorial Series to learn Common Lisp quickly
> One of my favorite examples is the regex library cl-ppcre. Thanks to the nature of Lisp, the recognizer for each regex you create can be compiled to native code on compiler implementations of CL.
That is not true - cl-ppcre generates a chain of closures. Experimental performance is in the same ballpark as typical "bytecode" interpreting regex implementations.
(Disclosure: I wrote another regex library at <https://github.com/telekons/one-more-re-nightmare>, which does do native code compilation.)
-
The self-hosted Zig compiler can now successfully compile itself
Someone else didn't tell me that before, so it can't be true. But I don't publish papers on toys, nor do I think toy projects are awfully fast. Though the x86-64 backend I wrote was in someone else's repository and thus was several PRs :(
-
Most interesting languages to learn (from)?
Regular expressions
-
Why You Should Learn Lisp In 2022?
A Common Lisp system has the compiler around at runtime, so if you can figure out how to profitably stage/specialise a computation, then you can roll your own cheap JIT of sorts. This can be useful for array munging and regular expressions at the least. You can do this in C, of course but you would need to use another compiler as a library (e.g. LLVM, TCC, libgccjit) or write your own (e.g. PCRE2's sljit).
-
The one-more-re-nightmare regular expression compiler
It's all part of the library. Everything about regular expression types is in this file.
-
[Question] Projects Ideas For the Slightly Unmotivated
Write a faster regex engine? Admittedly regular expression engines tend to be fast enough, but if you can use macros and compiling at runtime to compile them (indirectly) to machine code, they can go faster than fast enough.
zig
-
Zig, Rust, and Other Languages
https://github.com/ziglang/zig/blob/5cd7fef17faa2a40c8da23f0...
Generally speaking, it’s as mentioned just a convention. A zig library might not allow its users to pass allocators for example.
In C++, stl containers can take an allocator as a template parameter. Recent C++ versions also provide several polymorphic allocators in the stdlib. You can also override the global allocator or a specific class’ allocator (override placement new).
-
Nanos – A Unikernel
We need to remove that. We did have a channel on freenode a while back but got rid of it.
Outside of gh discussions there is also https://forums.nanovms.com/. We made a decision a while ago to follow Zig's lead here and have no 'official' community space (https://github.com/ziglang/zig?tab=readme-ov-file#community) instead letting people form their own spaces.
Zig also has an IRC channel on libera (#zig) that is moderated by Andrew Kelley.[1]
- Ask HN: What Underrated Open Source Project Deserves More Recognition?
-
Top Paying Programming Technologies 2024
1. ZIG - $103,611
-
MicroZig: Unified abstraction layer and HAL for Zig on several microcontrollers
ESP32 and STM32 support is very welcome!
I have been following https://github.com/ziglang/zig/issues/5467 for a while and progress seemed to have slowed significantly
-
Asynchronous Clean-Up (in Rust)
I have never used it directly, take what I say with a grain of salt.
As far as I know at least part of the idea was to eliminate the function coloring problem by letting the compiler do some nifty compile-time deductions. This had some issues (I don't know if this is still planned, it seems like the kind of thing that should not work in practice). Additionally, there were all sorts of hard technical issues with LLVM, debugging, etc.
I recommend checking the issue tracker, eg. https://github.com/ziglang/zig/issues/6025
I personally don't understand the domain well enough at all, but honestly, I feel like (if possible) Zig should try to double down on its allocator approach.
Instead of trying to use some compile-time deduction magic explicitly pass around an "async runtime/executor" struct which you explicitly have to interact with. Why not?
-
Show HN: Tokamak – A Dependency Injection-Centric Server-Side Framework for Zig
Atop your readme, you point out that nginx or another reverse proxy should be used. Kudos for that.
As for performance, I'd be curious what gains you get using `std.http.Server` with keepalive and a threadpool. Possibly you can re-use your ThreadContext - having 1 per thread in the threadpool that you can re-using. `std.Thread.Pool` is also very poorly tuned for a large number of small batch jobs, but that's a place to start.
[1] https://github.com/ziglang/zig/blob/b3aed4e2c8b4d48b8b12f606...
Yes, fundamentally. In Rust if you take a parameter of generic type T without any bounds, you cannot call anything on it except for things which are defined for all types. If you specify bounds, only things required by the bounds can be called (+ the ones for all types). Another difference is where you get an error when you try pass something which doesn't adhere to a certain trait. In Rust you will get an error at the call site, not at the place of use (except if you don't specify any bounds).
Zig is doing just fine without any trait mechanism and it simplifies the language a lot but it does come up from time to time. The usual solution is to just get type information via @typeInfo and error out if the type is something you're not expecting [0]. Not everybody is happy about it though [1] because, among other things, it makes it more difficult to discover what the required type actually is.
[0] https://github.com/ziglang/zig/blob/b3aed4e2c8b4d48b8b12f606...
What are some alternatives?
Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
Odin - Odin Programming Language
v - Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
rust - Empowering everyone to build reliable and efficient software.
go - The Go programming language
rust - Rust for the xtensa architecture. Built in targets for the ESP32 and ESP8266
ssr-proxy-js - A Server-Side Rendering Proxy focused on customization and flexibility!
TinyGo - Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
crystal - The Crystal Programming Language
regex - An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.
llvm-project - The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
Beef - Beef Programming Language