Hacker Newsnew | past | comments | ask | show | jobs | submit | dicytea's commentslogin

Yeah I aliased zi to z for this reason. z feels too much like a lottery ticket.

It already exists actually: https://github.com/TypeScriptToLua/TypeScriptToLua.

I had a pretty good experience with it while trying out Love2D.


That is one way.

What I meant was transpiling Luau (in memory or cached to disk) -> TypeScript -> typecheck with tsc -> take error outputs and line numbers -> transform back to Luau code via sourcemaps etc. This is potentially way easier than making your own checker for another structurally typed language.

User only sees Luau script in their editor, but it gets checked by TSC in the background.

Roblox might is such a big maker that they can re-invent the whole structural typing themselves, so they don't need to do that.


I really never understood the threat model behind this often repeated argument.

Most of these installation scripts are just simple bootstappers that will eventually download and execute millions lines of code authored and hosted by the same people behind the shell script.

You simply will not be capable of personally auditing those millions lines of code, so this problem boils down to your trust model. If you have so little trust towards the authors behind the project, to the point that you'd suspect them pulling absurdly convoluted ploys like:

> the web server behind mywebsite.com/foo.sh provides malware for the first request from your IP, but when you request it again it will show a different, clean file without any code

How can you trust them to not hide even more malicious code in the binary itself?

I believe the reason why this flawed argument have spread like a mind virus throughout the years is because it is something that is easy to do and easy to parrot in every mildly-relevant thread.

It is easy to audit a 5-line shell script. But to personally audit the millions lines of code behind the binary that that script will blindly download and run anyways? Nah, that's real security work and no one wants to actually do hard work here. We're just here to score some easy points and signal that we're a smart and security-conscious person to our peers.

> which are hosted by microsoft, and therefore easily MITM'able by government agencies.

If your threat model includes government agencies maliciously tampering your Deno binaries, you have far more things to worry about than just curl | sh.


I think bflesch's reasoning comes from the idea that the website developers may not hold their website to the same security standards as their software, and not from a trust issue. Nor from thinking the author themselves are malicious.

FWIW, I don't have a strong opinion here, besides that I like Debian's model the most. Just felt that it was worth to point out the above.


See the codecov incident, where exactly this happened: https://about.codecov.io/security-update/


From the intro[^1]:

> Odyc.js is a tiny JavaScript library designed to create narrative games by combining pixels, sounds, text, and a bit of logic.

[^1]: https://odyc.dev/doc/getting-started/intro


> Note that the author used disko to partition the disk declaratively. Disko won't work for a machine with very limited ram, because disko run in the installer, and needs to install tools to the ram to do the partition.

This is only true if you use the disko-install tool, which is a horrible footgun[^1]. The safest approach is to just use the default disko command, then nixos-install.

[^1]: https://github.com/nix-community/disko/issues/947


Thanks for bringing the disko command to my attention.

However, since we are talking about installing NixOS declaratively, and it's done through nixos-anywhere, which will install it[0] to the ram unfortunately.

[0]: https://github.com/nix-community/nixos-anywhere/blob/abb0d72...


Do you have any published benchmarks?


Comparative benchmarks are a big task on their own, and usually the author's library wins in them. I have internal benchmarks in the repository, but they are not designed for comparison or for evaluation by outsiders. Maybe I'll get to that someday.

As for the SoA approach, here you can find a small and exaggerated example: https://luajit.org/ext_ffi.html


> I could of course create my own type for this, but then it won’t work with the ? operator.

This is what the Try[^1] trait is aiming to solve, but it's not stabilized yet.

[^1]: https://rust-lang.github.io/rfcs/3058-try-trait-v2.html


> Some folks think you need to use Visual Studio

How's the LSP support nowadays? I remember reading a lot of complaints about how badly done the LSP is compared to Visual Studio.


Pretty good.

I started using Visual Studio Code exclusively around 2020 for C# work and it's been great. Lightweight and fast. I did try Rider and 100% it is better if you are open to paying for a license and if you need more powerful refactoring, but I find VSC to be perfectly usable and I prefer its "lighter" feel.


I still think Visual Studio is better, but you can easily work on small to mid-size projects in VSCode. Could you use Vim? I probably wouldn't, but you can say the same for Java.


bootc would be more attractive for this theming use-case, if there's a 1-line method to spin up a graphical VM straight from the docker file.

I looked into it, but it looks like that you need to manually build the image and fiddle around with qemu.


Yeah, a VM or just filesystem snapshots make much more sense.

Containers are so easy so people just started using them for every use case, even when it doesn't necessarily make the most sense.


Doesn't seem to be a problem, at least for Rust: https://godbolt.org/z/fToxz3d7a.

Functions with plain arguments and a struct both produce identical assembly output.



Try compiling with optimizations. I think by default this site doesn't add optimization flags.

Here what happens with optimizations: https://godbolt.org/z/G18zd7chP

Look at the registers usages vs stack


Got it! Thanks for the link.


Also worth noting clippy will warn about writing functions with too many arguments for the same reason listed in TFA

https://rust-lang.github.io/rust-clippy/master/index.html#to...


If you add a third argument you get different assembly


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: