HNHacker News
TopNewBestAskShowJobs

SirGiggles

145 karma · joined March 27, 2021

submissionscomments
SirGiggles··on Asterinas: OS kernel written in Rust and providing Linux-compatible ABI
I might be misremembering but I recall that Nvidia's BlueField DPUs use virtio when communicating with the host machine. From what I gather searching around it's virtio-net in specific
SirGiggles··on Digital River runs dry, hasn't paid developers for sales since July
To add on to your experience, my first encounter with Digital River was back around a decade a ago when I bought Battlefield 2142 from EA (pre-Origin)
SirGiggles··on Gleam Is Pragmatic
Would the async experiment also imply better interop between .NET languages?

One issue I’ve heard from F# devs was the lack of ability to comfortably call C# asynchrony methods

SirGiggles··on Gleam Is Pragmatic
I think a big difference is how C# uses stackless coroutines while anything on the BEAM uses stackful. How much cheaper is a good question however
SirGiggles··on Discord Reduced WebSocket Traffic by 40%
Sorry I want to apologize, I made an error in my initial statement and meant Erlang _External_ Term Format instead of Erlang Term Format.

Does this change anything w.r.t your response?

SirGiggles··on Discord Reduced WebSocket Traffic by 40%
Wouldn’t the ETF (Erlang Term Format) suffice in this case?

IIRC it’s used in the desktop client and some community libraries (specifically JDA) have support for it.

There were some quirks regarding ETF usage with Discord’s Gateway but I can’t recall at the moment.

SirGiggles··on Create your first LiveView Native (Elixir) Application
This might be answered elsewhere but how does LVN in its current state handle server disconnects (and for prolonged periods of time, in say no coverage zones)?
SirGiggles··on Libations: Tailscale on the Rocks
I think OpenZiti is an alternative in this space.
SirGiggles··on Retiring from the Rust for Linux Project – Wedson Almeida Filho
Unless I'm mistaken, LWN suggests it's Ted Ts'o

https://lwn.net/Articles/978738/

SirGiggles··on Replacing Liquid Metal on an Asus Zephyrus G15's CPU
Do you by chance mean the beta bios that enables USB4 functionality?
SirGiggles··on Orca: WebAssembly Apps Without the Web
a-Shell [1][2] has WebAssembly (and WASI) support and ships with a compiler that compiles to, you guessed it, Wasm. Though there are limitations on what can be done, such as no sockets, no forks, and etc...

[1] https://github.com/holzschu/a-shell

[2] https://holzschu.github.io/a-Shell_iOS/

SirGiggles··on Bcachefs, an Introduction/Exploration
Just want to do a follow up and make a correction that the command to go from whatever to RAID 6 for data and RAID 1c3 for metadata in Btrfs is instead: `btrfs balance -dconvert=raid6 -mconvert=raid1c3 /` instead of what I originally posted
SirGiggles··on Bcachefs, an Introduction/Exploration
What's your starting array look like? If you're already on Btrfs then I recall you could do something like `btrfs balance -d raid6 -m raid1c3 /`

https://btrfs.readthedocs.io/en/latest/Balance.html

SirGiggles··on Bcachefs, an Introduction/Exploration
Someone correct me if I'm wrong but to my understanding FB uses Btrfs in either RAID 0, 1, or 10 only and not any of the parity options.

RAID56 under Btrfs has some caveats but I'm not aware of any annecdata (or perhaps I'm just not searching hard enough) within the past few weeks or months about data loss when those caveats are taken under consideration.

SirGiggles··on CrowdStrike Update: Windows Bluescreen and Boot Loops
As others have already stated, yes, that is how we should be interpreting comments, in good faith and in the most charitable way as the site guidelines suggests us to.
SirGiggles··on AMD Unveils Ryzen 9000 CPUs for Desktop, Zen 5
I can’t speak for all motherboards but I’m comfortably running 128GiB of DDR4 on a 5950x and x570s platform.
SirGiggles··on The iPad Pro Manifesto (2024 Edition)
Did you respond to the wrong comment? You're also needlessly being an ass for no reason
SirGiggles··on The search for easier safe systems programming
Not the person you replied to but, today I learned!

As an aside, and as someone who's currently going through materials such as Crafting Interpreters (and who knows what else based on suggestions from r/compilers), is there a, I guess, guide for people who want to implement a compiler that targets the CLR/CLI?

I have a copy of CLR via C# 4th edition, but other than that not sure what else I can reference targeting anything newer than .NET Framework 4

SirGiggles··on .NET on Linux: What a Contrast
I _think_ those line of responses mainly come from the belief that because .NET versions since Core 1.0 has gone cross-platform that there is some expectation that the first-party GUI solutions would apply on platforms that have official ports of the runtime; and that since Microsoft is a behemoth then surely they could do it.

On a tangent and I also don't know how others would view this, but I personally think that trivial desktop applications have or will have moved on to solutions like (but not exactly server-sided) Phoenix Liveview or Blazor Server. No real need to bother with multi-platform solutions when there's already one the end user uses daily and is battle tested. The case of applications needing the usage of a GPU likes games aside that is.

> p.s.: I'm daily driving Ghidra currently which is built with Java Swing and it looks like straight out of 90s in a bad way haha

I don't know, I have a fondness of that old ass style of GUI lol

SirGiggles··on .NET on Linux: What a Contrast
Well Java has Swing that, iirc, works on all platforms OpenJDK runs on and Go doesn't have a sanctioned GUI in it's stdlib.
SirGiggles··on Pkl, a Programming Language for Configuration
Not completely related to the OP, but is Truffle going to be upstreamed as part of Project Galahad or will it remain as a library maintained by Oracle Labs?

I ask cause the Project Galahad page on openjdk.org is a bit sparse on details.

SirGiggles··on Helios: A distribution of Illumos powering the Oxide Rack
Is it possible you're thinking of the more recent AMD OpenSIL initiative?
SirGiggles··on Project Bluefin Linux
Thanks for the reply.

On the note of quay.io, is there a function on the website to see the Containerfile that created the artifact? I recall digging around in the past but couldn't really find a link to the source Containerfile.

SirGiggles··on Project Bluefin Linux
This is a tangent, but do you have a resource/link to where the base image is defined?

For example I saw that in your blog [1] you used the base on line 1 `FROM ghcr.io/cgwalters/fedora-silverblue:37`.

I was wondering where I could find the Containerfile for that, my Google-fu and searching through the Fedora pages are failing me

[1] https://www.ypsidanger.com/building-your-own-fedora-silverbl...

SirGiggles··on ChromeOS is Linux with Google’s desktop environment
It's to my understanding that the Neverware acquisition eventually led to ChromeOS Flex which is ChromeOS designed to run on any generic x86_64 platform.

https://chromeenterprise.google/intl/en_ca/os/chromeosflex/

https://support.google.com/chromeosflex/answer/11552529

SirGiggles··on How Async/Await Works in C#
> Also, just so that we understand each other: I'm a big fan of the BEAM.

We probably should've established this way earlier, sorry if I came across as pretentious or off putting.

I'll answer in a bit of reverse order.

> I just want to explain why I believe that function coloring (or however you call it) can never be conceptionally be removed from a language if sync/async is to be supported.

To respond in more of a roundabout way, why doesn't C have colouring issues if it too supports asynchronicity (I'm pretty sure I've made up a word but hope the point gets accross fine) via pthreads?

The colouring issue is, at least under my understanding of C#'s async/await system is to accommodate for the fact that Rosyln transforms the C# source into .NET IL with a state machine. It's, to me at least, just a consequence from what layer of the stack we talk at. Erlang doesn't need to worry about since the runtime was designed to run with this specific model of concurrency in mind; but if we look at C#, .NET only supports using OS threads (though David Fowler is investigating green threads in the, iirc, labs repository on the DotNet Github) the async/await is, for lack of a more better word, bolted on. It's to my understanding that IronPython (or maybe it was PythonNet) has difficulties calling into C# async for that reason; though if I'm wrong please correct me.

> is the sole purpose of the existance of those primitives to change performance characteristics? If not, what is the purpose of its existence then?

Fault tolerance, latency, scalability, perhaps minor throughput increases (yeah this is a bit of a contradiction to what I said earlier, but I've revised my opinion that you wouldn't see massive performance gains unless resorting to NIFs).

The Phoenix Framework's 2 million websocket connection challenge I think is a best demonstrator for the use case of BEAM processes. A specific websocket connection dies? No problem, the Supervisor respawns it. Two million connections receiving a Wikipedia length article on a topic without the entire system coming to a crawl? No problem. There isn't a need to worry about kqueue, poll/epoll, or IOCP here, just fire off a task for the purpose and let it do it's thing.

But overall you wouldn't spawn a BEAM process just so you could compute the matrices behind RAID6/RAIDZ2, you'd delegate those to NIFs. The biggest gains in overall performance came from BeamAsm instead.

> Okay, let me follow up on this one. So could we take arbitrary Erlang/Elixir programs and automatically/mechanically rewrite them to push previously inlined calculations to be run on a different process (using spawn) or the otherway around - and that without causing any observable difference in behaviour in any situation except for difference in performance?

Yes. Using the case of the 2 million websocket connection challenge earlier, it doesn't really matter if each of those connections spawned another process as part of its routines, the other processes don't know and don't care. Taking a more generic case of Elixir's GenServers (or gen_server in Erlang), when I perform a call (as in the GenServer behaviour) it doesn't matter to the calling process what happens behind the scenes, it just blocks and waits for a response. The GenServer could fire off any number of processes it wants but the calling process doesn't care about that.

SirGiggles··on How Async/Await Works in C#
> They are not equivalent. Running a function in another process incurs the overhead of copying the data to the other process (potentially over the network). In both directions.

> Moreover, there is a context switch and it's more likely the code will run on a different core if you run it async than if you run it in the same process (which is very likely but not guaranteed) to run on the same core.

Yes I agree, but the question as presented by valenterry asks us whether or not there is some existing semantic difference and not under the confines of performance (both gains or losses). Regardless what you have stated are all true.

But as an aside, and not directed towards you, Task.async/3 doesn't do anything that the developer cannot already do. Even in the tutorial for the learning Elixir, the fledgling developer is exposed to the different mechanisms that power Task.async/3, the source code [1] reflects this, although supervisors are covered much later down the line. The documentation for

> The way in which they are equivalent, is that the code that you write is identical, and the bytecode that gets run, and the existence of implicit yields is identical between the async and "sync" code.

And just to add on for those not familiar with the BIFs, receive, which is what Task.await/2 and Task.yield/2 use under the hood, yields execution. NIFs are another one.

[1] https://github.com/elixir-lang/elixir/blob/fb729784e5504f499...

SirGiggles··on How Async/Await Works in C#
> Sure, but that was not my question. 100% equivalent means that there cannot be any observable change in the behaviour of the whole program/application (except for performance).

In a vacuum (i.e. via spawn/1 or spawn/3) there is no observable change in behaviour throughout the whole system.

If they're linked via spawn_link then a child process crashing means the parent process dies with it unless handled in some way.

So ultimately, no there isn't observable changes. My logging process doesn't care or even know that my WebSocket process crashed.

> Or in other words: is the sole purpose of the existance of `Thread.async` (or spawn, pick whichever you want) to change performance characteristics? If not, what is the purpose of its existence then?

As stated before Task.async/3 is just a convenience wrapper around low-level BEAM primitives, there isn't anything special about Task.async/3 that you couldn't do via spawn.

The reason being that the BEAM VM schedulers prioritizes overall latency of the system over throughput by enforcing reduction calls (parlance for a function call, but specifically for tracking looping in the BEAM) at around 4000 calls, then it moves the current process back into the queue; repeat ad infinitum.

So you don't get massive speedups just spawning a new BEAM process but your independent units of execution still enjoy the same overall latency as before. If you want performance increases in the BEAM you would need to jump to dirty schedulers and NIFs which carry their own dangers.

SirGiggles··on How Async/Await Works in C#
No, they're equivalent. It makes no difference whether I calculate in the current process, spawned a process, started a process via the Supervisor, Task.async, or what not. They are all equivalent in the sense that they use BEAM processes.

An Elixir, Erlang, or any other developer using the BEAM VM (or at the very least myself since I don't want to generalize) doesn't make a semantic distinction between spawn and Task.async/3 because there is none. The significant differentiation is whether or not the caller is expecting a returned value, if not then Task.start_link can be used instead.

I don't need to worry about function colouring because there is none. I also don't need to worry about async vs Task.run like in C# because in Elixir there is none. To be asynchronous in Elixir/Erlang/etc... is to be synchronous. To equate it to modern backends, we basically have a microservice but every service can directly call each other.

I think I also might have been talking around you a bit, the BEAM VM sets itself apart from C#'s async/await or the TPL due to its implementation of the actor model. This video by Sasa Juric can explain better than I can the general overview of the BEAM: [1].

But a rough tl;dw, a BEAM process is to the BEAM, what an OS process is to the OS. We don't define a main function as the process supervisor in BEAM spawns processes we define instead and those are our "entrypoints."

[1] https://www.youtube.com/watch?v=JvBT4XBdoUE

SirGiggles··on How Async/Await Works in C#
The BEAM VM doesn't have faculties to accommodate any other form of concurrency other than synchronous, pre-empted green threads. Put simply, there is nothing other than synchronous in Elixir (edit: or Erlang or any other BEAM VM language). The Task module is basically just convenience functions (edit: convenience functions around existing BEAM VM functions for spawning BEAM processes or Erlang threads) meant to facilitate short term execution of, well, tasks.

Task.async/3 and Task.await/2 are, from the thousand foot view, the equivalent of:

  parent = self()
  spawn(fn -> send(parent, do_something()) end)
  receive do
    result -> IO.puts result
  end
In Elixir/Erlang parlance, I have just spawned a thread where the BEAM VM handles both the internal data structures to facilitate concurrent-safe communications between threads and the scheduling in userspace.

Put more generally, the mentality of concurrency in Elixir/Erlang is the equivalent as that of traditional pthreads in C.

← PreviousPage 2 of 4Next →