News for hackers. Stuff that matters.
Re:Has there ever been an attempt to create a high/low level... by Xorathena on Thursday January 25, 2024 @09:57PM (#39138428)
...like the past few decades of Python/Ruby/Node/etc wrapping C-ABI libraries from any language?

https://docs.python.org/3/extending/extending.html

https://nodejs.org/dist/latest-v20.x/docs/api/n-api.html#nod...

https://docs.python.org/3/library/ctypes.html

https://swig.org

When using Zig functions and structs on the low side there are some nice opportunities for making the low/high interface more automatic at comptime, especially when you're jointly compiling (your Zig code + a Zig-based Python interpreter + your Python code) together into one WASM blob.

Disclaimer/public-commitment-to-getting-it-released: I've written most of a Python interpreter in Zig as part of another project. (just the basics — won't be big and professional like CPython.) I'll reply here eventually when it's done, available as FLOSS, and ready to say "high-low".

Re:Has there ever been an attempt to create a high/low level... by DanielHB on Friday January 26, 2024 @04:22AM (#39140471)
ABIs are not enough, it is a huge pain in the ass to setup the function invocations, especially cross-platform. Having separate compiling and linking steps for each part of the codebase and stuff is a huge pain.

I think Bun (NodeJS-compatible runtime) was planning to add native support for importing C and Zig code directly from JS with typescript codegen. But even that is still a bit meh, you also need some data-exchange format so you can pass complex data structures without paying a serialisation/deserialisation cost.

Re:Has there ever been an attempt to create a high/low level... by Qem on Thursday January 25, 2024 @09:24PM (#39138244)
Was going to mention Smalltalk/Slang and PyPy/RPython, pleased to see people already pointed them.

There was even a Smalltalk implemented using RPython, but unfortunately that project seems not to be active. Last change 5 years ago: https://github.com/hpi-swa/RSqueak

Re:Has there ever been an attempt to create a high/low level... by agumonkey on Thursday January 25, 2024 @10:48PM (#39138735)
informally I read about many many lispers ending up doing their own assembler to enjoy live/dynamic metaprogrammable native code

other languages ended up adding this (can't remember the name) depending on their niche, because one always hit performance issue

Re:Has there ever been an attempt to create a high/low level... by 082349872349872 on Friday January 26, 2024 @02:56AM (#39139917)
Just in the 1980s:

  Forth/asm
  C/asm
  shell/C
  all langs on VMS
  TCL/C
  etc.
Re:Has there ever been an attempt to create a high/low level... by PH95VuimJjqBqy on Friday January 26, 2024 @06:45AM (#39141574)
I feel like C++ is the answer here, only it's a single language rather than two.