HNHacker News
TopNewBestAskShowJobs

ColonelPhantom

645 karma · joined October 28, 2016

submissionscomments
ColonelPhantom··on The Heart of Unix (2018)
It's not nonsense; the point is that calling a Numpy function needs to be done from Python. You cannot pipe stdin to np.array().
ColonelPhantom··on The Heart of Unix (2018)
I find the word 'homoiconic' very hard to define anyway. For example, I think Tcl is also often described as homoiconic, which manifests in being able to make e.g. custom control structures (https://wiki.tcl-lang.org/page/code+is+data) although something like Haskell also deals with that quite well. However, in say Javascript, you would need to use special syntax when using every {} so that the block content can be seen (e.g. by wrapping it in a function, or passing it as a string to be eval()ed).

In the case of Unix, the question is probably "what is the canonical representation of executable code". I think the author's intent was to mostly talk about shell scripts, and not something like C code. Manipulating shell scripts via e.g. sed is, I think, pretty doable.

I'm also a bit confused why homoiconicity needs to be convenient to be real. Most people don't find shell a very convenient language in other aspects, either.

ColonelPhantom··on Ask HN: Could Qualcomm Buy Intel?
I believe most newer x86_64 patents are held by Intel (e.g. AVX). As such if Intel is taken over they would still hold them, right?
ColonelPhantom··on Why Haskell?
I disagree that the 'arcane sigil invocations' are necessarily a problem. Yes, they can be, but I also think they can definitely be preferable!

Naming everything as a function often leads to a problem of very deep visual nesting. For example, map-then-filter can be written as "filter p . map f" in Haskell, whereas in sigil-free languages you'd write a mess like (lambda (x) (filter p (map f x))) in Lisp or "lambda x: filter(p, map(f, x))" in Python.

Of course, function composition is a very simple case, but something like lenses are another less simple case where a library would be unusable without custom operators.

ColonelPhantom··on Intel's Immiseration
OneAPI is an implementation of SYCL. Apart from being standardized by Khronos, SYCL and OpenCL don't have that much in common, except that they are often interoperable due to many SYCL implementations running on top of OpenCL. Intel specifically has two backends, one for OpenCL and one for the lower-level Level Zero API.

Saying OneAPI/SYCL is bad "because OpenCL" is the same as saying OpenCL is good "because CUDA" (since the NVIDIA implementation of OpenCL is called CUDA and uses the larger CUDA stack).

As for the FPGA/GPU code sharing, iirc FPGA vendors including Altera/Intel and Xilinx/AMD support OpenCL as well. The idea doesn't sound that crazy to me: GPU code also often uses small data types (fp16, tf32, int4), and both work with data parallelism. GPUs operate in parallel with SIMD vectors, but a compute accelerator FPGA achieves a similar thing by essentially pipelining the program. Effective pipelining requires parallelism too, since a serial FPGA program only has one stage active, similar to how a serial GPU program only has one ALU per compute unit active. As such both are mostly suitable for massively parallel programs.

ColonelPhantom··on Functional languages should be so much better at mutation than they are
Hm yeah, I'm not sure what astrange's point was, other than probably dissatisfaction with the combination of exceptions and Either (which I think is awfully named, as it implies a certain 'equality' between l and r).

I haven't used Bluefin, but don't Bluefin exceptions suffer from the same issue where it, essentially, 'infects' the program flow? For example, `fst (5, error "second")` seems like it would translate to `fst $ (5,) <$> throw e "second"`, where you would also need to pull an `e` from somewhere. More realistic, something like head would probably be quite awkward:

head e [] = throw e "head: empty list" head e (x:xs) = pure x

You now need to pass in the exception handle, and the return value is now `Eff es a` instead of `a`. This means that you cannot just use the result, so you will likely need to fill your program with monadic stuff like do-notation, <$> and <$>, complicating the program flow and likely also reducing laziness.

ColonelPhantom··on Functional languages should be so much better at mutation than they are
By simulating exceptions, do you mean a `Result t e` type (which Haskell calls `Either l r`)? You can use these and the Functor/Applicative/Monad hierarchy to handle errors.

What is presumably talked about is that Haskell also has actual exceptions, generated by calling e.g. `error` or `undefined`.

The semantics of these are.. interesting, mostly thanks to lazy evaluation. For example, `fst (5, error "second") ` is safe to evaluate because the second half of the tuple is a thunk and does not get evaluated. Additionally, there is, to my knowledge, no way to handle exceptions in pure code, presumably due to the undefined evaluation order.

That said, I'm not sure what the alternative would be, because a function like !! (list indexing) can fail and dealing with its fallibility would be a big burden on the programmer.

ColonelPhantom··on How simultaneous multithreading works under the hood
GPUs are actually SMT'd to the extreme. For example, Intel's Xe-HPG has 8-wide SMT. Other vendors have even bigger SMT: RDNA2 can have up to 16 threads in flight per core.
ColonelPhantom··on Zen 5's 2-ahead branch predictor: how a 30 year old idea allows for new tricks
It's worth noting that compilation is a partially serial task (e.g. linking is often largely single-core). It's entirely possible that going from 4 to 8 threads is much more helpful than 12 to 24 threads, as a 24-thread system will have far more idle threads in comparison. (Of course this is assuming 4c8t Skylake, so a normal consumer i7. Skylake-X had more cores.)
ColonelPhantom··on Zen 5's 2-ahead branch predictor: how a 30 year old idea allows for new tricks
Correct. However, Zen 5 seems to be the first major 'scaling up' that AMD has done since the original Zen, given that the core seems to be moving from dispatching 6 to 8 instructions per clock and 4 to 6 ALUs. I would expect that SMT to be excellent for low-IPC workloads to get the most out of that scaling.
ColonelPhantom··on Kompute – Vulkan Alternative to CUDA
You don't need X to run OpenCL, only a driver. Pretty sure the same holds for OpenGL.
ColonelPhantom··on AMD to buy Silo AI for $665M
SYCL also doesn't meet the listed requirement of 'Intel and AMD teaming up'. Intel seems to be the only hardware vendor to actually care about SYCL, and AMD is instead backing HIP which is 'standardized' but boils down to 'just take cuda and run :s/cu/hip/g'.

If AMD were to work on SYCL tooling and, say, build a 'syclcc' next to 'hipcc' that ingested SYCL to run it on ROCm, I feel like interest in SYCL could potentially grow, since Intel is supporting it properly already and it would be actually a cross-vendor standard.

Codeplay (which is part of Intel) does provide 'plugins' to run oneAPI (SYCL) on NVIDIA and AMD hardware, which is great but is still being made, indirectly, by Intel, who in the end want to sell Intel hardware.

ColonelPhantom··on AMD MI300x GPUs with GEMM tuning improves throughput and latency by up to 7.2x
OK, but isn't the memory management stuff part of the API? :)

And with HIP, the user-facing memory model is virtually identical to CUDA to my knowledge. Converting a CUDA program to HIP, assuming no unsupported features or platform details are used, is basically just "do s/cu/hip/g".

Also, HIP wasn't around in 2014. To program an AMD GPU back then, you were probably using OpenCL, which is nicely platform independent but also arguably somewhat archaic.

ColonelPhantom··on AMD MI300x GPUs with GEMM tuning improves throughput and latency by up to 7.2x
What makes you think that CUDA's value prop is memory management? I have seen no indication that implementing the memory allocation system is the hard part of any GPGPU system, and HIP is mostly source-compatible with CUDA, so it's not like the user has to do anything different memory management-wise to run on AMD.
ColonelPhantom··on Open source 'Eclipse Theia IDE' exits beta to challenge Visual Studio Code
The side ribbon of VSCode is called the Activity Bar. You can put it on top of the sidebar (making it more like a tab bar) or disable it entirely (which makes it a lot harder to open the sidebar or change the page it's on).

It's as simple as right click it -> Activity Bar Position -> ...

ColonelPhantom··on Testing AMD's Giant MI300X
Did you talk to anyone from Intel? It seems they were also present: https://community.intel.com/t5/Blogs/Tech-Innovation/Artific...
ColonelPhantom··on Mozilla roll out first AI features in Firefox Nightly
Man, I was actually kind of happy about Mozilla's seemingly-measured response to the AI hype, and mostly running local models to perform actually useful tasks (translation, alt text generation).

But I really don't think cramming a bunch of proprietary online services like ChatGPT counts as "intentional and methodical". It comes across more like a "we need AI!!!" cry of desperation, throwing principles like privacy in the wind.

ColonelPhantom··on When are SSDs slow?
My laptop (a Dell Latitude 5490, i5-8350u) with the screen backlight off and at idle goes down to 2.5w power consumption according to the battery statistics. An SSD idling at 1.9w would nearly double it!
ColonelPhantom··on Asus' first Snapdragon X Elite laptop (mostly) blows away the MacBook Air M3
Then why is the fanless model, the Air, the cheapest laptop Apple is selling?
ColonelPhantom··on Thoughts on Skymont Slides
I'm not entirely sure about the backend, but for the frontend Intel has come up with a 'split decoder'. Essentially, Skymont will have 3x 3-wide decoders working in parallel on different parts of the instruction stream. I have no idea how they find points to perform load-balancing between these clusters (outside of taken branches), but the 2x3-wide setup in Gracemont seems to work like a charm after some improvements over Tremont which debuted the split decoder scheme.

> This scheme appeared with Tremont, where it could only switch decoders at taken branch boundarie and Gracemont improves load balancing between the two decode clusters by automatically switching, instead of relying on taken branches. That helps performance in very long unrolled loops, which could get stuck on one decode cluster on Tremont. When we tested with longer loop lengths, we didn’t see any drop off in Gracemont’s instruction throughput:

- https://chipsandcheese.com/2021/12/21/gracemont-revenge-of-t...

ColonelPhantom··on In Colorado, an ambitious new highway policy is not building them
> Roads are physical easy to understand

???

Yes, roads require less 'active upkeep', an austerity government might stop funding transit but they will not close roads. However, this is more of a feature of the supposed 'independence' of car transport, not 'easy to understand'.

In addition, defunding transit would be a lot harder and weirder if it is in a form that requires actual infrastructure (metro, train, tram) rather than some stops and a schedule (bus). That's one potential reason to trust bus transit projects less.

Do keep in mind that roads aren't free after construction either; they typically require pretty significant upkeep (especially things like repaving, but also e.g. traffic signals).

ColonelPhantom··on In Colorado, an ambitious new highway policy is not building them
> Nothing is as expensive as your time.

Then public transport should be way cheaper than driving, as on transit you have some downtime where you can scroll through your phone, listen to some music, or perhaps even crack open your laptop if you're on a proper train. Driving requires constant attention, so you can't relax or do anything else in the meantime.

ColonelPhantom··on In Colorado, an ambitious new highway policy is not building them
Just because public transport is a poverty tax where you went to school does not mean buses and especially other transit are inherently for poor people. Buses do tend to be mediocre for longer distances, but the main issue is general quality of service.

I grew up in a region with fairly mediocre transit, but because the living environment is not hostile most things can easily be done by bike unless you need to go to another city. Hell, I biked 8km to school, and while somewhat time consuming it was quite literally free exercise.

When I went to uni, before moving to that city I relied on transit. Because of the low density in the region, trains are only half-hourly (which is by far the most sucky part) and it's on single-track rails so every train stops at all stations. However during rush hour it's still time-competitive with cars, and transfers are generally pretty good because those are the reason transit works in that region at all.

Something like "you need a car to be able to get to (store)" that's mentioned in another comment would be literally unthinkable here. You can get practically anywhere with a bike and a transit card.

ColonelPhantom··on In Colorado, an ambitious new highway policy is not building them
It is very easy to scale them as demand increases. There is a train to the next city over where I live in the Netherlands (both around 150k) around 10x per hour on weekdays. And that's on a single, dual track with a mix of 3 direct (intercity) trains and 2 slow trains that have 3 stops inbetween.

The intercity trains, when in a maximum length 6+6 car configuration of 2-floor trains, can carry over 1200 (sitting!) passengers. That's as much as a single lane of road can carry in half an hour with average car occupancy (low). So running such a train every 15 minutes should give a similar capacity to a free-flowing road with 2 lanes, while needing less room for infrastructure. Plus people mostly go to the station by foot, bike or bus rather than car, which is also nice capacity-wise and pollution-wise.

ColonelPhantom··on A Road to Common Lisp (2018)
When using Python, the REPL does not feel remotely integral to the experience. For example, my Django project, when an exception occurs in debug mode, has a nice page with a backtrace et cetera. However, I cannot resume, or poke around using a REPL, or even view details of local variables. I feel like if Django was implemented in Common Lisp this would not be a problem at all, if not for technical reasons then for cultural reasons.
ColonelPhantom··on Bollards: Why and What
No, it's in Europe and you're not "expected" to go over the limit at all.

If you want to step on it, leave the city. Most non-access roads in non-built-up areas are 50mph, and more for motorways. Some major urban thoroughfares are also 45mph.

ColonelPhantom··on Bollards: Why and What
20mph on a residential street is perfectly reasonable. Urban roads on the other hand are usually more like 30-35mph where I live, which is also perfectly fine.
ColonelPhantom··on Infini-Gram: Scaling unbounded n-gram language models to a trillion tokens
Aren't LLMs a classification problem in a sense? "Given this text, classify it based on the next token" seems like a viable interpretation of the problem. Although there are a couple thousand or so classes, which might be a lot (but I know very little about this field).
ColonelPhantom··on The Adwaita Icon Theme no longer follows the FDO spec, breaking e.g. KDE apps
That's probably libadwaita (the successor to libhandy), which by the way also forces the Adwaita GTK theme. This post is about the Adwaita _icon_ theme. Those are 3 different components (solib, CSS, icons) that all happen to be called Adwaita.
ColonelPhantom··on Optimizing your programs for Arm platforms
> Some GPUs have used vectors in the past

Which ones? I'm aware of AMD/ATi Terascale using VLIW, but I'm pretty sure that architecture also used SIMD (requiring the use of both VLIW and large 'waves' to achieve maximum occupancy).

And running shaders on CPU is, in essence, a similar programming model to ISPC. When you run OpenCL on a CPU I am quite certain that the runtime pretends each lane is a program instance, same as ISPC.

← PreviousPage 3 of 13Next →