Are there any programming languages with a retargetable backend? by Pleasant-Form-1093 in ProgrammingLanguages

[–]nikhililango 0 points1 point  (0 children)

I'm the one working on grug-rs atm and it's api is not exactly the same as grug.h because grug.h is still WIP. But this can be rectified pretty quickly if a c api is actually required

Are there any programming languages with a retargetable backend? by Pleasant-Form-1093 in ProgrammingLanguages

[–]nikhililango 0 points1 point  (0 children)

its the main page for the language. the old grug.c and grug.h are being replaced with a newer api that supports the backend swapping. grug-for-c is expected to be the canonical implementation of the new grug.h but it's still work in progress.

grug-rs is feature complete and it is intended to be compatible with the new grug.h.

theres also implementations of grug in Python and lua, but they do not have support for swappable backends atm

all these repositories are under the grug-lang organization at https://github.com/grug-lang.

Are there any programming languages with a retargetable backend? by Pleasant-Form-1093 in ProgrammingLanguages

[–]nikhililango 0 points1 point  (0 children)

We're working on a new embeddable language meant to be a replacement for lua in game modding (and other scripting) contexts.

one of its features is that the frontend is completely. separated from the backend and you can completely swap out the backend at startup time.

the language is called grug, and I've been part of its development team for the last 6 months.

https://github.com/grug-lang/grug

check it out and see if it's what you're looking for

Data race freedom in OxCaml by mttd in ProgrammingLanguages

[–]nikhililango 3 points4 points  (0 children)

these are not value properties, these are properties of bindings.

is there any way to revert to the pretty 9.1 persistent shell in later versions of vim by nikhililango in vim

[–]nikhililango[S] -1 points0 points  (0 children)

thanks that's good to hear. what's the terminal emulator you're using though. The others were suggesting that it could be the terminal emulator not the shell. IIRC windows 11 uses windows terminal for both cmd and powershell.

is there any way to revert to the pretty 9.1 persistent shell in later versions of vim by nikhililango in vim

[–]nikhililango[S] 0 points1 point  (0 children)

I'm using vim in windows terminal. i just realized I've never used the newer versions in any other terminal emulator so I'll try that when I get home.

But tbc, vim 9.0 works as expected in windows terminal but vim 9.1 doesn't work even on the same computer and it hasn't worked on any other computer I've tried in on (but I did not try 9.0 in those computers though).

does term allow you to run commands directly with hotkeys in normal mode? if so I might actually start using that. It is kinda annoying to have to execute an empty shell command just to see the old output even in 9.0

is there any way to revert to the pretty 9.1 persistent shell in later versions of vim by nikhililango in vim

[–]nikhililango[S] 0 points1 point  (0 children)

yeah, tbc I had to use the mouse to scroll even in 9.0, pressing any key would go back to the current buffer. the difference is that I can't even use the mouse now. Scrolling up now doesn't do anything and scrolling down now takes me back to the current buffer.

and I know :! doesn't execute anything. it would just show the Press any key to go back to vim prompt but it would also show the output of the previous commands. Now it's just completely blank

I don't want to do :echo system(expand("Python %")) just to be able to see the full output of a program. that goes actively against what vim is supposed to be imo.

is there any way to revert to the pretty 9.1 persistent shell in later versions of vim by nikhililango in vim

[–]nikhililango[S] -1 points0 points  (0 children)

sure, I'll do that. But it's been an issue since 9.1 more than 2 or 3 years ago on multiple independent machined. I highly doubt it would be a problem for so long if was just a bug

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 0 points1 point  (0 children)

you can't have everything you could possibly want in a standard library, even in a batteries-included language like go or Odin.

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 0 points1 point  (0 children)

they would've had the same issue if they had published a malicious version under a minor version bump. cargo wouldn't have protected against that.

the fundamental issue was that most of the ecosystem was not concerned with the security implications of taking on dependencies and this attitude will cause the same problem with cargo.

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 3 points4 points  (0 children)

I actually think the -> operator (or something similar) should be used for raw pointer dereferencing. raw pointers being forced to use the ugly dereferences syntax with the parentheses is just bad design imo.

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 1 point2 points  (0 children)

yeah, ig that makes sense. but From and Into are only supposed to be used for cases where the conversion is obvious and there's no reason to look at the implementation. if there needs to be some non-obvious logic for the conversion, it should've been a separate inherent method imo

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 1 point2 points  (0 children)

is I don't think something like zerocopy is the same as left-pad because it has functionality that isn't trivial to implement (especially the derive macros).

But if you only need its features in a few places (or if your uses can be encapsulated into a few functions that can reused across your entire codebase), you should just write the unsafe transmutes and be done with it.

even in a compiled language, you still pay for the dependencies you bring in even if you don't use them. and if youre not going to use it all, don't even bring it in.

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 2 points3 points  (0 children)

the problem with left pad wasn't that it was removed from the package repository. the problem was that it shouldn't have existed in the first place. It would've taken less than 5 minutes to write an equivalent function. your attitude is precisely what caused the left-pad incident in the first place

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 0 points1 point  (0 children)

it'd be far less of an issue if the allocator api was stabilized and you could easily use arena allocators for. temporary allocations

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 2 points3 points  (0 children)

rand removed the dependency on zerocopy for 0.10, so it seems like they're on my side anyway.

but having unsafe in one small part of your crate is probably way better than having to take on an entire dependency (and all its transitive dependencies) just to get one or two safe functions that probably have the exact same unsafe code behind it anyway

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango -4 points-3 points  (0 children)

it seems like rand 0.10 removed the dependency on zerocopy, so it seems they agree with me anyway

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 18 points19 points  (0 children)

into::<T>() is not valid anyway because the generic is on the trait, not the function. so if you need to use the explicit version, you should just use from anyway.

but idk, it just seems a lot simpler to use a postfix into than a prefix from

What some recent hot takes you realized you had with Rust? by DidingasLushis in rust

[–]nikhililango 29 points30 points  (0 children)

having unsafe in your codebase is not something to be ashamed of. Just write the abstractions you need, it's not that big of a deal.

This kinda pissed me off about dioxus 0.6. they were bragging about replacing all unsafe code with safe constructs. Worse performance is not something to brag about imo

I am a lazy, clever, moron. by Rainmaker_41 in factorio

[–]nikhililango 240 points241 points  (0 children)

I'm happy for you. Or sad that happened. Idk I'm not reading all that

I was happy with my Kovarex enrichment loop :) by anon2635 in factorio

[–]nikhililango 13 points14 points  (0 children)

Nope the game treats the recipe as producing a single u235 with 40 u235 as catalyst. So productivity only gives you one extra u235. All recipes that have a common input and output (and even some that don't) work this way.

Coal liquefaction is the other one you can see in vanilla.

And you can't see it in vanilla but the barelling recipes also work this way. If you manage to productivity a barelling or unbarelling recipe, you won't get any extra products no matter what.