Better HN
topnewbestaskshowjobs
Log inSign up

AkshitGarg

102 karma · joined Jul 24, 2020 (6y ago) · 55 submissions

Submissions

1.

VMScape: Exploiting Incomplete Branch Predictor Isolation in Cloud Environments(comsec.ethz.ch ↗)

6 points · by AkshitGarg · 1y ago · discuss

comment 1y ago · link · parent

I feel this benchmark compares apples to oranges in some cases.

For example, for node, the author puts a million promises into the runtime event loop and uses `Promise.all` to wait for them all.

This is very different from, say, the Go version where the author creates a million goroutines and puts `waitgroup.Done` as a defer call.

While this might be the idiomatic way of concurrency in the respective languages, it does not account for how goroutines are fundamentally different from promises, and how the runtime does things differently. For JS, there's a single event loop. Counting the JS execution threads, the event loop thread and whatever else the runtime uses for async I/O, the execution model is fundamentally different from Go. Go (if not using `GOMAXPROCS`) spawns an OS thread for every physical thread that your machine has, and then uses a userspace scheduler to distribute goroutines to those threads. It may spawn more OS threads to account for OS threads sleeping on syscalls. Although I don't think the runtime will spawn extra threads in this case.

It also depends on what the "concurrent tasks" (I know, concurrency != parallelism) are. Tasks such as reading a file or doing a network call are better done with something like promises, but CPU-bound tasks are better done with goroutines or Node worker_threads. It would be interesting to see how the memory usage changes when doing async I/O vs CPU-bound tasks concurrently in different languages.

comment 2y ago · link · parent

IIRC that runs a x86_64 userland (using Rosetta) on a arm64 kernel.

comment 3y ago · link · parent

You use attrs [1] instead. I personally find this much more readable, and prefer this.

  slog.Info("hello, world", slog.String("user", os.Getenv("USER")))
[1]: https://pkg.go.dev/log/slog#hdr-Attrs_and_Values

5.

Tell HN: YouTube is not showing home recommendations when watch history is off

9 points · by AkshitGarg · 3y ago · 8 comments

comment 3y ago · link · parent

Windows also supports containers: https://learn.microsoft.com/en-us/virtualization/windowscont...

7.

heavy.js: make your site heavy with a single script(github.com ↗)

3 points · by AkshitGarg · 4y ago · discuss

comment 4y ago · link · parent

ReScript doesn't uses esbuild. It has its own compiler: https://github.com/rescript-lang/rescript-compiler

comment 4y ago · link · parent

Chrome and Firefox on iOS are just skinned safari with their own sync and features. Apple does not allow third party browser engines and you absolutely have to use the one built into the system (webkit).

comment 4y ago · link · parent

According to its README, it does run (and is tested) on WSL 2 (Ubuntu) (amd64).

comment 4y ago · link · parent

It has been there since atleast windows 95.

Screenshot: https://i.imgur.com/vCJF5UW.png

comment 4y ago · link · parent

Yep you need to specify the maximum memory amount up-front. Its defined as "webassembly memory pages". Each page is 64kb. You need to specify an initial and a maximum amount. The webassembly module can call memory.grow() to grow it by a page until it reaches the maximum. Though you can't "un-grow" or decrease the amount of allocated memory.

comment 5y ago · link · parent

Not the OP, but my editor colors the parenthesis red in case of an imbalance [0].

I do have a minimal amount of highlighting though.

[0]: https://imgur.com/haVWset

comment 5y ago · link · parent

I grew up with fully fledged syntax highlighting, but I still prefer to use really minimal themes as I find them to reduce cognitive overhead and eye strain.

It was hard for the first few hours, but then I eventually got used to it, and now I can't use anything else.

I know this is not quite as extreme as working without syntax highlighting :)

comment 5y ago · link · parent

While I don't fully disable syntax highlighting, I use a minimal theme [0,1] that only has highlighting for comments, strings and globals. It reduces eye strain for me, and I never find myself relying on highlighting to navigate through code.

LSPs provide an "outline" which can be very useful to navigate through code. I find "jump to symbol" function in my text editor to be faster than scanning all of the code to find the line.

Also most themes dim the comments, but IMO if something in the code needed an explanation, it should be brighter, not dimmer.

[0]: https://github.com/tonsky/sublime-scheme-alabaster

[1]: https://github.com/gargakshit/vscode-theme-alabaster-dark

comment 5y ago · link · parent

Not only firefox, but edge, chrome and safari too. EFF is deprecating HTTPS everywhere. See https://www.eff.org/deeplinks/2021/09/https-actually-everywh...

comment 5y ago · link · parent

> given enough work, run Python directly in Wasm

It is already possible! See https://github.com/pyodide/pyodide

comment 5y ago · link · parent

You can use vscode's web editor [0] which allows you to open local folders and even run full LSPs for JavaScript, TypeScript and Python

[0]: vscode.dev

19.

Show HN: Chip-8 interpreter with a fancy GUI made using C++ and Dear ImGui(github.com ↗)

5 points · by AkshitGarg · 5y ago · discuss

comment 5y ago · link · parent

That might be unrelated to the audit database change as NPM is currently having a service outage.

https://status.npmjs.org/incidents/7pqfqvkwvb58

comment 5y ago · link · parent

The NATS protocol [0] looks pretty simple, but is text based unlike MQTT which uses a size optimized binary protocol.

[0]: https://docs.nats.io/nats-protocol/nats-protocol

comment 5y ago · link · parent

Erlang includes erlang bindings for wxWidgets as used by observer and debugger. It is certainly possible to use them for making desktop GUIs.

comment 5y ago · link · parent

You can use WSL to mount ext4 and other filesystems supported in linux.

https://docs.microsoft.com/en-us/windows/wsl/wsl2-mount-disk

comment 5y ago · link · parent

Noto uses Apache-2.0 [1] which should be fine for most stuff.

[1]: https://github.com/googlefonts/noto-emoji/blob/main/LICENSE

comment 5y ago · link · parent

Flutter web has issues with accessibility. They do support screen readers once you enable accessibility by pressing a button, but its rather bad right now. Also scrolling is emulated and doesn't feel great.

comment 5y ago · link · parent

So much of this. In my CS class, I could hardly find anyone who actually had some curiosity to learn. Everyone does their homework by sharing answers on the class chat. And in team projects, either there is one person who does all the work, or they end up copying from google and stackoverflow.

comment 5y ago · link · parent

Not to mention a lot of critical components of modern infrastructure like docker, podman and kubernetes are built using go
12