Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

I have a daydream.

Uncategorized
16 3 0
  • I have a daydream. Maybe (probably not) next year will be the year I try to execute on it.

    I want to make a runtime-interpreted, gradually typed version of Rust. I want it to be able to load+run regular Rust code, but also I want it to support something like "var x = [rust expression]", where "x" winds up being treated like it is of type GarbageCollectedRefCell<Option<Variant>>.

    I want this for a few reasons. In my head, I have a really good name for it, which I will not tell you at this time.

  • I have a daydream. Maybe (probably not) next year will be the year I try to execute on it.

    I want to make a runtime-interpreted, gradually typed version of Rust. I want it to be able to load+run regular Rust code, but also I want it to support something like "var x = [rust expression]", where "x" winds up being treated like it is of type GarbageCollectedRefCell<Option<Variant>>.

    I want this for a few reasons. In my head, I have a really good name for it, which I will not tell you at this time.

    Reasons I want this:

    - I want to write Rust code with runtime-interpreted code.

    There are contexts where Interpreted, Untyped is just The Way You Want To Do Things. Types are friction, you don't want that friction for like a quick script that moves some files around.

    I do "creative code" stuff. I do games. Prototyping means many quick experiments you discard. You don't want to waste time refactoring types! You would prefer to write your game logic in something like a scripting language.

  • Reasons I want this:

    - I want to write Rust code with runtime-interpreted code.

    There are contexts where Interpreted, Untyped is just The Way You Want To Do Things. Types are friction, you don't want that friction for like a quick script that moves some files around.

    I do "creative code" stuff. I do games. Prototyping means many quick experiments you discard. You don't want to waste time refactoring types! You would prefer to write your game logic in something like a scripting language.

    (cont)
    Right now, the best way to do this is mlua. mlua is fricking great, actually. But there are issues.

    - I wrote a very large program in a mix of C and Lua awhile back, and code switching actually *does* get frustrating. But there's a hidden problem which is bigger than the cognitive dissonance of syntax changing between files.

    You wind up duplicating your work on both sides of the line! Say your app does matrix multiplication. Eventually, you will need matrix multiplication *everywhere*.

  • (cont)
    Right now, the best way to do this is mlua. mlua is fricking great, actually. But there are issues.

    - I wrote a very large program in a mix of C and Lua awhile back, and code switching actually *does* get frustrating. But there's a hidden problem which is bigger than the cognitive dissonance of syntax changing between files.

    You wind up duplicating your work on both sides of the line! Say your app does matrix multiplication. Eventually, you will need matrix multiplication *everywhere*.

    (cont)
    If the reason for the split is "Lua is for 'business logic', C is for high performance stuff", you'd think you'd want the matrix multiplication on the C side. But things will never work out that politely. At some point in a single function you'll wind up going, oh, I gotta mutiply this matrix, it would be really inconvenient to move all this over the line. And invariably, a larger and larger set of utility functions wind up being duplicated 3 times (C, Lua, GLSL).

  • (cont)
    If the reason for the split is "Lua is for 'business logic', C is for high performance stuff", you'd think you'd want the matrix multiplication on the C side. But things will never work out that politely. At some point in a single function you'll wind up going, oh, I gotta mutiply this matrix, it would be really inconvenient to move all this over the line. And invariably, a larger and larger set of utility functions wind up being duplicated 3 times (C, Lua, GLSL).

    - There is a second problem with "partly in Rust, partly in Lua". Rust is greedy! Rust is a totalizing system. C is pretty easy to interface with other languages; C++, less so. Rust has all kinds of things that don't map well into other languages but are *important*.

    Why is everything being rewritten in Rust these days? I have a theory. It's because Rust has all these really great libraries people want to use. And the only way to access them is Rust, since *Rust doesn't interoperate well!*

  • - There is a second problem with "partly in Rust, partly in Lua". Rust is greedy! Rust is a totalizing system. C is pretty easy to interface with other languages; C++, less so. Rust has all kinds of things that don't map well into other languages but are *important*.

    Why is everything being rewritten in Rust these days? I have a theory. It's because Rust has all these really great libraries people want to use. And the only way to access them is Rust, since *Rust doesn't interoperate well!*

    (cont)
    Like, Rust *can* interoperate— as I said, mlua's great. But the interop is such that you have to do a bunch of *work* to expose functionality in Rust primitives to another language.

    Rust (glossing over many things) was supposed to be a language for writing VMs, for writing *one* VM, Servo. It's designed for interop. It's *designed* for the "the hard parts in this compiled language, easy parts in JS". But the hard parts aren't hard enough. It's easier to just write it *all* in Rust!

  • (cont)
    Like, Rust *can* interoperate— as I said, mlua's great. But the interop is such that you have to do a bunch of *work* to expose functionality in Rust primitives to another language.

    Rust (glossing over many things) was supposed to be a language for writing VMs, for writing *one* VM, Servo. It's designed for interop. It's *designed* for the "the hard parts in this compiled language, easy parts in JS". But the hard parts aren't hard enough. It's easier to just write it *all* in Rust!

    (cont)
    At least, this is the trap I'm in. I'd like a scripting language, but my scripting languages can't easily access Rust stuff, and a lot of what I want to use is in Rust, so I just use Rust. Suboptimal.

    Hence, a solution: *The scripting language should use the Rust ABI*. I'm not sure this has ever been done fully. There are several scripting languages which are Rust-flavored or sit atop Rust, I've skimmed docs for a couple. As far as I *know* "just interpret Rust" would be a novel one.

  • (cont)
    At least, this is the trap I'm in. I'd like a scripting language, but my scripting languages can't easily access Rust stuff, and a lot of what I want to use is in Rust, so I just use Rust. Suboptimal.

    Hence, a solution: *The scripting language should use the Rust ABI*. I'm not sure this has ever been done fully. There are several scripting languages which are Rust-flavored or sit atop Rust, I've skimmed docs for a couple. As far as I *know* "just interpret Rust" would be a novel one.

    - I've been dealing with "writing in 2 languages means duplication/annoying refactors" a long time.

    Thus, my daydream for a long time has been a programming language that's interpreted/compiled dual mode, such that "porting" across the interpreted/compiled line is just a matter of adding types until there are no untyped statements left. (From what I hear Racket tried this, and there were huge problems. Not sure if I should take this as a warning against trying, or a guide for things to avoid).

  • - I've been dealing with "writing in 2 languages means duplication/annoying refactors" a long time.

    Thus, my daydream for a long time has been a programming language that's interpreted/compiled dual mode, such that "porting" across the interpreted/compiled line is just a matter of adding types until there are no untyped statements left. (From what I hear Racket tried this, and there were huge problems. Not sure if I should take this as a warning against trying, or a guide for things to avoid).

    (cont)
    I at one time thought I'd do this by taking an interpreted language and adding types (this was Emily 2). It turns out writing a typechecker is hard! Writing a compiler is hard! I never got the full thing working. Okay, I give up. Somebody already wrote the Rust compiler. I'll go the other direction. Start with a compiled language I like using, give it an interpreted mode. Solve the "compilers hard" and "Rust interop annoying" problems at once!

  • (cont)
    I at one time thought I'd do this by taking an interpreted language and adding types (this was Emily 2). It turns out writing a typechecker is hard! Writing a compiler is hard! I never got the full thing working. Okay, I give up. Somebody already wrote the Rust compiler. I'll go the other direction. Start with a compiled language I like using, give it an interpreted mode. Solve the "compilers hard" and "Rust interop annoying" problems at once!

    This thread got ungainly & apparently I needed 1000-character posts to write it coherently. But I have been stewing in these ideas for several years and some *variant* of them for like, 15 years. This might actually happen. Last year I wrote a language interpreter in Rust (a flimsy LISP) and it wasn't so hard. Eventually some version of this will happen. The nice thing is even if it's terrible, it has the defense "well, use it during dev, then rewrite the whole thing in Rust before you ship it".

  • This thread got ungainly & apparently I needed 1000-character posts to write it coherently. But I have been stewing in these ideas for several years and some *variant* of them for like, 15 years. This might actually happen. Last year I wrote a language interpreter in Rust (a flimsy LISP) and it wasn't so hard. Eventually some version of this will happen. The nice thing is even if it's terrible, it has the defense "well, use it during dev, then rewrite the whole thing in Rust before you ship it".

    Tangential thought:

    A really funny thing is almost everything good about Rust comes down to when it was written. It has excellent LLVM integration because it was written right after LLVM happened. It has a good build system because the build system was written after pip and npm. It has great libraries because all the libraries were written between 2020 and 2024 and so they're all modern. Not sure where I'm going with this but it makes me wonder how Rust will age.

    "How Rust will age". Heh.

  • Tangential thought:

    A really funny thing is almost everything good about Rust comes down to when it was written. It has excellent LLVM integration because it was written right after LLVM happened. It has a good build system because the build system was written after pip and npm. It has great libraries because all the libraries were written between 2020 and 2024 and so they're all modern. Not sure where I'm going with this but it makes me wonder how Rust will age.

    "How Rust will age". Heh.

    Tangent:

    Imagine this approach for "interpreting" a Rust-like language. You link against LLVM; you *actually compile* the Rust into machine code, in memory; when you want to invoke your script, you simply jump to that code. This is the approach used by Julia and (optionally) GHCi, and it has many advantages.

    I wouldn't use it, at least not at first, because it makes your "interpreter" non-embeddable. LLVM is tens of megabytes. It also excludes you from W^X ("no JIT") platforms (iPhone, wasm).

  • Tangent:

    Imagine this approach for "interpreting" a Rust-like language. You link against LLVM; you *actually compile* the Rust into machine code, in memory; when you want to invoke your script, you simply jump to that code. This is the approach used by Julia and (optionally) GHCi, and it has many advantages.

    I wouldn't use it, at least not at first, because it makes your "interpreter" non-embeddable. LLVM is tens of megabytes. It also excludes you from W^X ("no JIT") platforms (iPhone, wasm).

    It is my opinion there is virtually no good reason for an distributed executable to ever be larger than ten megabytes, and for a program without art/sound assets I'd lower that ceiling to something like one to four megabytes. I am aware this is a deeply antiquated opinion but it is the opinion I have. I think this is also the attitude you need if you want to make a language that targets wasm. I have made a serious attempt at JITing C# to ASM.js. There were… there were executable size problems.

  • It is my opinion there is virtually no good reason for an distributed executable to ever be larger than ten megabytes, and for a program without art/sound assets I'd lower that ceiling to something like one to four megabytes. I am aware this is a deeply antiquated opinion but it is the opinion I have. I think this is also the attitude you need if you want to make a language that targets wasm. I have made a serious attempt at JITing C# to ASM.js. There were… there were executable size problems.

    @mcc I often think about how a 16MiB 486 was perfectly capable of displaying and editing any document a human could reasonably write. Advances since then have allowed for higher fidelity images, and audio/video playback, and yet software that does neither still consumes gigabytes of RAM. I hate often wondered about adapting a coredump analysis tool to do a top-down breakdown of how the address space is actually used...

  • @mcc I often think about how a 16MiB 486 was perfectly capable of displaying and editing any document a human could reasonably write. Advances since then have allowed for higher fidelity images, and audio/video playback, and yet software that does neither still consumes gigabytes of RAM. I hate often wondered about adapting a coredump analysis tool to do a top-down breakdown of how the address space is actually used...

    @kitten_tech I feel like audio/video editing worked really well on circa 2000 computers and I'm not completely certain we do it better now

  • @kitten_tech I feel like audio/video editing worked really well on circa 2000 computers and I'm not completely certain we do it better now

    @mcc @kitten_tech Video editing worked ok around then, but more advanced editing was assisted by specialized hardware. This included the switch to HD and DTV sometime between 2001 and 2007 (maybe more but that’s when I worked in the industry). There were some serious limits with the PCI bus. I remember being one of the few people benchmarking PCI latency.
    Asside from HD, mpeg4/avc, and encoders, one of the big leaps at the time was the speed of consumer hard drives.

  • oblomov@sociale.networkundefined oblomov@sociale.network shared this topic on

Gli ultimi otto messaggi ricevuti dalla Federazione
  • Good morning Fedi friends!

    I hope you're having a nice weekend.

    I'd like to clear the air re: #WSocial and my opposition to it.

    I got a lot of messages on my Mastodon account (several over private DM) trying to dissuade me from speaking up about it and urging me to work on improving the fediverse instead.

    I hear you.

    But I disagree.

    I experienced the same thing last year, when I mentioned I had incendiary evidence about the lack of content moderation on Substack. I had many examples of posts and replies inciting racism, homophobia, fatphobia and xenophobia and spreading dangerous health misinformation. I had taken screenshots and reported them. When I checked back months later, none of my reports had been acted upon. I am talking about seriously heinous messages that are still on there. When I mentioned this on the fediverse, I got many responses urging me "not to waste my time" and "to stay positive" and to "focus instead on helping the fediverse." I did that. Meanwhile Substack is still incredibly popular and most people - even those using it - have no idea of the heinous speech that is allowed on it... and sometimes even monetized. I honestly regret not speaking up. It may not have made a difference, I know (I'm not a megalomaniac) but it makes my skin crawl to think some of the heinous comments are still on there and a young person could come across them and think they are ok. I should have spoken up.

    Now, W Social where do I start? Sure, my criticism of it is from a completely different angle. All I want to do is write ONE blog post about its problematic aspects and then I will move on. What is so objectionable about it?

    Years ago I wrote a blog post citing all the problems about Dove and its Real Beauty Campaign. It may not have been much, but it was over 10 years ago and the post is still getting hits today. You can see it for yourselves if you look up "The Problem with Dove" and "The Illusionists."

    I'm very very lucky to have a little bit of influence on here - I'm immensely grateful for it - and even if I'm preaching to the choir as they say, maybe my advocacy can make a little bit of difference.

    My hunch is: staying silent and wishing W Social away is not the way to go. They had a very rushed, botched announcement with no existing product or users. Major security flaws in their setup (I have plenty of evidence). I'd like to write something that you could reference and share... since so far no journalists did any research and simply rehashed the press release of W Social. That's irresponsible reporting – P.R. masked as journalism and it needs to be rectified. That's all I want to do: a blog post about "The Problems with W Social" that hopefully with a sprinkle of SEO magic people can easily find. What's so bad about it? 4 hours of my time and then I'll move on.

    Your loyal fedi advocate,

    Ele

    read more

  • When it's really cold, I leave food on the front porch to lure feral cats so I can herd them inside. Tonight I went out to check the food, saw it was gone, and there were dog tracks in the snow. I don't want any cats out in this weather, but there really can't be dogs out in this weather, but I have no idea what to do about it. I put more food out, which hasn't disappeared since, and I'm hoping that means the dog has gone inside somewhere. Gonna walk around the area before heading to bed..

    read more

  • Grazie ar cazzo, lo stanno imponendo con tecniche da scammer su tutti i dispositivi compatibili

    https://daringfireball.net/2026/01/ios_26_adoption_rate_is_not_bizarrely_low

    read more

  • @KFears @afreytes tone and form does help, but sadly a single asshole making the worst scene about a cultural norm violation can be enough to prevent the receiver from listening to more expressive recommendations. Maybe we need to improve our policing of tone policing? Hard to say.

    read more

  • How does Amazon Prime Video break its browser tab but no other streaming services do? I thought they were all just JavaScript frontends to the build-in video support in the browser...how can one make it chew 100% of CPU and end up crashing its tab, while nobody else does?

    read more

  • @Massimiliano_Bordina @la7tv montaruli fdi condannata in cassazione mai carcere ma in commissione vigilanza rai!

    read more

  • In cultures like Korea and Japan, taking off your shoes at home is a long-standing tradition. I'm curious about how this practice varies across different regions and households in the fediverse.

    How does your household handle shoes indoors?

    read more

  • This post did not contain any content.
    read more
Post suggeriti
  • Good morning Fedi friends!

    Uncategorized wsocial
    1
    0 Votes
    1 Posts
    0 Views
    Good morning Fedi friends!I hope you're having a nice weekend.I'd like to clear the air re: #WSocial and my opposition to it.I got a lot of messages on my Mastodon account (several over private DM) trying to dissuade me from speaking up about it and urging me to work on improving the fediverse instead.I hear you.But I disagree.I experienced the same thing last year, when I mentioned I had incendiary evidence about the lack of content moderation on Substack. I had many examples of posts and replies inciting racism, homophobia, fatphobia and xenophobia and spreading dangerous health misinformation. I had taken screenshots and reported them. When I checked back months later, none of my reports had been acted upon. I am talking about seriously heinous messages that are still on there. When I mentioned this on the fediverse, I got many responses urging me "not to waste my time" and "to stay positive" and to "focus instead on helping the fediverse." I did that. Meanwhile Substack is still incredibly popular and most people - even those using it - have no idea of the heinous speech that is allowed on it... and sometimes even monetized. I honestly regret not speaking up. It may not have made a difference, I know (I'm not a megalomaniac) but it makes my skin crawl to think some of the heinous comments are still on there and a young person could come across them and think they are ok. I should have spoken up.Now, W Social where do I start? Sure, my criticism of it is from a completely different angle. All I want to do is write ONE blog post about its problematic aspects and then I will move on. What is so objectionable about it?Years ago I wrote a blog post citing all the problems about Dove and its Real Beauty Campaign. It may not have been much, but it was over 10 years ago and the post is still getting hits today. You can see it for yourselves if you look up "The Problem with Dove" and "The Illusionists."I'm very very lucky to have a little bit of influence on here - I'm immensely grateful for it - and even if I'm preaching to the choir as they say, maybe my advocacy can make a little bit of difference.My hunch is: staying silent and wishing W Social away is not the way to go. They had a very rushed, botched announcement with no existing product or users. Major security flaws in their setup (I have plenty of evidence). I'd like to write something that you could reference and share... since so far no journalists did any research and simply rehashed the press release of W Social. That's irresponsible reporting – P.R. masked as journalism and it needs to be rectified. That's all I want to do: a blog post about "The Problems with W Social" that hopefully with a sprinkle of SEO magic people can easily find. What's so bad about it? 4 hours of my time and then I'll move on.Your loyal fedi advocate,Ele
  • 0 Votes
    1 Posts
    1 Views
    How does Amazon Prime Video break its browser tab but no other streaming services do? I thought they were all just JavaScript frontends to the build-in video support in the browser...how can one make it chew 100% of CPU and end up crashing its tab, while nobody else does?
  • Ennò Donard!

    Uncategorized
    2
    0 Votes
    2 Posts
    0 Views
    @GiorgiaMecojonima... la "vera" Giorgia Mecojoni, sicuro contraddirebbe Donard? Non la riconosco più...
  • 0 Votes
    18 Posts
    1 Views
    @KFears @afreytes tone and form does help, but sadly a single asshole making the worst scene about a cultural norm violation can be enough to prevent the receiver from listening to more expressive recommendations. Maybe we need to improve our policing of tone policing? Hard to say.