HNHacker News
TopNewBestAskShowJobs

gens

503 karma · joined April 2, 2016

submissionscomments
gens··on Write a Shell in C
CHAR_BIT is a minimum of 1 byte (8 bits), but is not guaranteed to be 1.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf (Annex E)

gens··on Hybrid supercapacitor offers NiMH energy density, charges much faster
As others have said, the energy that a supercapacitor can store is practically nothing compared to lipo. And that is by weight, when supercapacitors are less dense then lipo.

If you want more power you can just put more batteries in parallel. Or use batteries with lower resistance (the flat ones).

As for gathering bursts of energy; Again the problem is energy capacity. The (potential) energy released by braking really hard is really high (per time).

You could use a flywheel battery for that. They can take it. They are even used in roller coasters just for that purpose (granted they use big flywheels).

Considering people usually break "softly", it is just not worth it.

gens··on Tesla's new steering yoke isn't retro, it's a safety risk
Having a tablet instead of air-conditioning and radio volume nobs is also a safety risk.
gens··on Tesla’s charging stations left other manufacturers in the dust
> The industry setting the standards is the problem, which is why Tesla had to create Superchargers as a proprietary standard ..

For one, there is now n+1 standards. For the more important point, tesla could have made their standard free instead of proprietary.

They are in it for the money. Not any "greater good" or "advancement of humanity" or any other such bullshit. Money. And it's obvious if you look and not listen to them (this includes apple and such).

Tesla is a part of "the industry".

gens··on LZ4 – Extremely fast compression
I tried compressing BC7 (from AMD-s Compressonator) using lz4c and it wasn't much.

Just re-ran it (with -hc, version 1.9.3(latest now)) and: "Compressed 5592544 bytes into 5413783 bytes ==> 96.80%".

7z with "7z a -mx=9 -t7z asd.7z albedo_PNG_BC7_1.KTX" does 5592544 bytes to 4844707 bytes (down to ~87%).

Original file is 10227047 bytes (PNG, RGBA), i can't remember if the ktx has mipmaps.

EDIT: Note that the image is fairly noisy (gravel). Could/should be better with more "artificial" textures.

I don't know if ktx does some extra compression, but, looking at it, i doubt it.

PS I think that BC could be massaged at compression to be better compressible, and i think i read something about that. Don't remember.

gens··on LZ4 – Extremely fast compression
It is used, and most every other compression technique was/is used in video games.

I was thinking of using LZ4, but it doesn't really work that great on floating point, and images are already compressed (png, jpg, and even BCn, can't be compressed much further). So idk. Good thing about lz4 is that it's very simple[0] and probably faster then memcpy().

http://ticki.github.io/blog/how-lz4-works/

gens··on Ask HN: What are you working on?
I'm making a game/engine with efficiency/performance as a top goal. I'v spent years thinking about the design. And after i figured it out, i found a talk from an Ubisoft employee that is mostly what i came up with.

The problems are many, especially since i want to support multiplayer. The biggest solutions are around how data is transformed and scheduling the code that transforms it, more or less.

The talk: https://www.youtube.com/watch?v=X1T3IQ4N-3g

gens··on WRT54G History: The Router That Accidentally Went Open Source
Everybody says so. I'l have to get one for myself some day. With a cheap 24V scooter battery one could even use it in the field without a problem.

Oh, and i seem to have underestimated Louis's recommendation. He likes it a lot.

https://www.youtube.com/watch?v=ao39bPEyok4

On the topic of open source for hardware; There's an open source software for Hantek oscilloscopes http://openhantek.org/ (not official) , which is yet another thing i'l have to get myself some day.

gens··on WRT54G History: The Router That Accidentally Went Open Source
Turns out http://www.uychan.com/ is the original.

Since i can't edit, reply.

gens··on WRT54G History: The Router That Accidentally Went Open Source
http://www.miniware.com.cn/product/ts100-soldering-iron-pack...

An open source soldering iron, original by a Chinese company Miniware. I don't know how good their sales are, but the iron is so good it got that Louis Rossmann praised it (for the price, ofc). And it seems to be very popular (probably not nearly as much as Weller, but hey).

gens··on Should you Work Hard? (2019)
"My grandfather rode a camel, my father rode a camel, I drive a Mercedes, my son drives a Land Rover, his son will drive a Land Rover, but his son will ride a camel"

- Rashid bin Saeed Al Maktoum

gens··on Hallucinations re: the rendering of Cyberpunk 2077
https://learnopengl.com/

This is good. The rest is more of theory. I can dump you a lot of papers, talks, and reviews like the OP one.

gens··on Pointers Are Complicated II, or: We need better language specs
That is what i said, that it can be optimized away.

"exist" is the wrong word, "is useless" would be better. It is like.. you have a spanner in a box labeled "a" and you have a box "b" that has a piece of paper that says "look in a". You ask for a spanner and you get told to look in box "a". The box labeled "b" is then completely useless. One day some guy, weirdly named "compiler", decides to trow away box "b", and nobody cares.

But we have to assume that a compiler will compile the program just as we wrote it. Otherwise we are not talking about the language, but about the compiler. This is gone off topic, if there even was one.

gens··on Pointers Are Complicated II, or: We need better language specs
If 'b' is actually used then the compiler has to put 'a' in memory. Theoretically. He says that b is not changed, and does not "escape" (the scope of the code in question). In that case b is useless, and thus it doesn't really even exist. A compiler can "collapse" a lot of code into a fraction of it. That's a part of the "optimizing" part of "optimizing compiler". A compiler can put a value in a register. A compiler can do whatever it wants as long as the results are always the same as if it didn't do anything other then just translate to machine code.

Pointer aliasing in C can be bad for the compiler as it can't be sure that it can optimize away something. That's why Fortran is faster, and why the restrict keyword was added to the C standard.

And yea, i agree with him completely that a context should be made clear. Personally i'd like less voodoo in programming topics, but, on the other hand, this is still a young science and a lot of terminology is all around the place. ..Actually, scratch that, i found what i was interested in and don't really care about everything else.

gens··on Pointers Are Complicated II, or: We need better language specs
Pointers are "just" integers (unsigned integers of a size, that is). Most languages treat them differently (C assigns them a type, and a stride with it), but that is usually on top of them being integers.

Pointers "point" to (are addresses to) bytes, as he said. If you want you can pack data to a resolution of a bit, and some languages help you do that as well.

You can also do whatever you want with pointers (in some languages, ofc), like do bitwise operations on them. Aliasing them can be useful as well, in more then one way.

Why not just get rid of pointers ? You know you can.

Also, a byte is 0 .. 255. The hardest problem; naming things, and off by one errors.

gens··on Cyberpunk 2077 runs on Linux through the Proton compatibility layer
Did you ever wonder why some programs work and some don't ? Luck does not have much to do with it. I have some games that were made many versions of glibc ago, and they still work. Why is that ? (that is a rhetorical question)
gens··on Cyberpunk 2077 runs on Linux through the Proton compatibility layer
> Because if you start to support Linux you actually have to support all the major distribution (Debian, Arch, Ubuntu, Fedora, etc.) with their different idiosyncrasies, package format, libc implementations and/or version, etc.

That is plain wrong. I don't know who started with that line of reasoning, but it is very wrong.

The only good reason for not supporting linux are the drivers. And they will change more with time then with distro.

And no, solution is not flatsnaps. If there even is a problem, the solution is much simpler.

gens··on Pfizer Covid vaccine approved for use next week in UK
If you want to keep the amount of dead people to a minimum, then it makes sense to first vaccinate those who are most likely to die.

HN-ians like to model stuff, and i get that. To do it properly we need to know how many "young"(active ppl) there are, how many old with lung problems, the rates of propagation in and between those, and probably other stuff. But the goal is to keep the deaths down, and my opinion is that by far the smartest way is to first vaccinate the vulnerable people and those who deal with them directly (nurses, etc.). There's also a lot of points about practicality. For example; If i get infected not much happens (i'd just have to isolate myself, even with heavier symptoms). But if my mother gets those severe symptoms she would need to go to the hospital, if she would live at all.

Even if the math says it's better to vaccinate the young ones first, i'd still argue that it's overall safer to vaccinate the vulnerable ones first.

gens··on How io_uring and eBPF Will Revolutionize Programming in Linux
When you want to squeeze every bit of performance out of a system, you want to avoid doing system calls as much as possible. io_uring lets you check if some i/o is done by just checking a piece of memory, instead of using read, pool, or such.
gens··on How io_uring and eBPF Will Revolutionize Programming in Linux
You are right. For most programs, these two are more work for not much payoff.

Though they are great for some things.

gens··on Borderland Between Rendering and Editor – Part 2: Picking
Nice that it works with various deformations, but because of the latency and more shaders i'l skip this. I have still learned some things from this post.
gens··on Single Writer Principle (2011)
Checking out what Alan Kay has to say about it might help: https://www.youtube.com/watch?v=fhOHn9TClXY

The way i see it OOP is about encapsulating/bundling data and the code that processes that data into one "object", that is isolated from other objects. The objects could only "communicate" with other objects by sending "messages" (data/events/something).

Personally i don't like OOP, and think that focusing on data and how it's processed is a better way forward (CSP and such). It's.. a complicated matter.

gens··on Systemd, ten years later: a historical and technical retrospective
udev was the biggest step towards "dynamic systems". Or should i say "hotplug" was, since it is more or less the same thing. I completely agree that the init should be an event based system. I'm not arguing that. I never argued that. I did not in fact argue much other then the statement that nobody should say their opinion about anything.

You say i left out stuff. I did. A lot more stuff then you wrote here. It would be a looooooong list of things, all of them simple (including "networking" and encrypted filesystems). I mentioned udev as an example of something slightly more complex, but even it is not.

> .. much better model than SysV init ..

You talk as a user, as in an admin. I talk as someone who was once interested in how all these stuff actually work. What i played with (read about, coded, and researched in general) includes init, udev, network hardware management (how ip and iw actually do stuff, excluding wpa), and more. What have i learned ? That almost all of it is done by the kernel. SystemD is not the only.. program that responds to events and goes over a graph and such. In fact, it is not even that hard to do what it does. Remember how i asked why udev doesn't have a generic event.. protocol ? You can scrap udev if you don't use systemD. And why ? For better integration ? The kernel tells udev when a device appears. So why doesn't udev just send a message of some sort ? It could even have a "mode" where it doesn't do anything unless it receives a message telling it to. So why not ? Oh, i don't think it's malice.

> The Debian community had a deep examination of the alternatives and picked systemd because it made sense, not because Red Hat has some brainwashing program.

The debian debate was a clusterfuck of grand proportions. There was one (1!) post on the whole debate that addressed the technical aspects. In the end the conclusion was that it is easier to just use systemD as stuff depends on it more and more (GNOME, notably, funny). RH is a huge company, they are not altruistic in their goals. I wouldn't say malice, but i wouldn't say innocence either.

And again, nothing of substance was said. Just fancy words and feelings. Brainwashing..

PS Fun fact: Xorg depends on udev to send it events over dbus when you plug something related to it. It still works without it, until you re-plug your mouse.

gens··on Systemd, ten years later: a historical and technical retrospective
Voting share ? There is no vote unless you work for RH. And even then.

An init system is harder then it seems ? You and Jonnax seem to think that unless you made it you have no right to say anything. Have you ever made an init system ? Researched what exactly goes into it ? Sure, there's more then just starting programs. But not much more. The only really complicated thing about getting a [linux] computer from kernel boot to firefox is setting up devices. And even that [udev,"hotplug"] is not complicated as much as it is.. obscure. I know about these stuff, do you ?

I'l defend a newbies right to say anything. Nobody was born with all the knowledge of the world. I will not have compassion for your kind of ignorance.

SystemD is about as much an init as my foot is me. That is the problem that most of those you so casually dismiss have with it. That and that it wants to become mandatory. Could they have just extended udev instead of integrating it ? An i wrong to say that ? Is my opinion wrong because i don't have "Red Hat senior engineer" next to my name ? Programming is just a hobby for me. I don't even have a degree in it. So i'm ignorant on the subject ?

Funny thing.. most of those on teh internets who are vehement in favor of systemD don't know much about how a computer system boots and what goes into that.

edit: Never mind. I see feelings and fancy words are still more valuable then knowledge or thinking. Maybe one day, when computing is not as young of a science as it is now.

gens··on Rust Survey 2019 Results
https://stackoverflow.com/questions/21177436/is-there-a-publ... 6 years ago.

I was going to compare how many pages the rust standard has, and compare it to the C standard (plus 20% for the "correctly manage memory" that you pointed out as something extremely complicated). http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

Anyway.. C is a rather simple language. No matter what the opinion of rust programmers is.

Please don't respond to this post. At least not with the bog standard "undefined" "unsafe/memory" and other shallow conceptions.

gens··on Gleam: A statically typed language for the Erlang VM
Concurrency.. the way i understand it, it is about making parts of the program run independent of each other and thus can run at the same time.

But you might want to check out someone who knows better, like Rob Pike: https://www.youtube.com/watch?v=cN_DpYBzKso

Yes, Erlang makes concurrent programs easier to write.

Again it is better to listen to someone who knows more, like the creator of Erlang Joe Armstrong: https://www.youtube.com/watch?v=bo5WL5IQAd0 Any talk by him is great.

Erlang, in how i see it, makes it easier to write concurrent programs because:

1. Parts of a program communicate with other parts by passing messages

2. Every variable is static, as in if you declare that A is 12 you can not change it to be 13

Joe Armstrong had a way of explaining these things so that even i could understand, so i do recommend watching every talk you can find of him. I also recommend the interview he did of Alan Kay https://www.youtube.com/watch?v=fhOHn9TClXY .

But if you want to really get into concurrency i recommend a paper called "Communicating Sequential Processes" by C. A. R. Hoare. See http://www.usingcsp.com/

It's a "formal language" for dealing with concurrency. Go, and some other languages, implement a "CSP style" way of doing concurrency.

Erlang doesn't do SIMD, nor GPU. However, it does world scale low latency systems.

Of course, it's still up to the programmer to do everything correctly and Erlang is just a tool.

I don't quite like *JS, so i won't say anything about that.

gens··on Lucid Motors' Peter Rawlinson Talks E-Car Efficiency
Hence you will try to keep the conduction losses low relative to switching losses.

Yea, 1kHz is nothing for modern transistors. FET, IGBT or bipolar. Not that it's not worth considering them, ofc.

gens··on Lucid Motors' Peter Rawlinson Talks E-Car Efficiency
From what i remember when i cared about such things:

It's the gate capacitance (and gates resistance) that leads to switching losses. Usually the biggest part of the switching losses is because the transistor is not fully "on" or "off" for the whole time, but is in between when in the process of switching. The gate capacitance is probably one of the biggest problems (more for FET, but also for bipolar), that influences the speed of the transistor (presented as frequency or as slew rate). Otherwise you could just put a bunch of MOSFET-s in parallel and get much lower resistance, thus greater efficiency (and it works, to a point).

Another thing to consider is that FET-s let the current go back and a motor is an inductive load, while bipolar transistors do not. I forgot how much that matters, but it probably does plenty.

Thankfully electronics is one of those fields of engineering where you can get all the information you need from a datasheet. Unlike from those damned headphone manufacturers (embarrassments to engineering, 99.9% of them).

PS "..you will tend try to keep switching losses low relative to conduction losses.." I think you meant the other way around.

gens··on “C is how the computer works” is a dangerous mindset for C programmers
C is a high level language.

C is close to how a computer works.

Assembly is the next step down, and is not nearly as hard as the internet would lead you to believe.

Step down from that; read a book like "Computer Architecture: A Quantitative Approach", and learn about cpu-s and memory (also Agner Fog's site, official amd and intel doc, many other).

Down from that is electronics (logic gates, 8bit adder, etc., down to transistors and capacitors).

And beyond is physics.

Everything else is either computing theory or buzzwordy bullshit.

To repeat: C is a high level language, no matter what anyone says.

gens··on Pwn2Own Vancouver 2019: Tesla, VMWare, Microsoft, and more
You need to wait a bit.

Anyway. I'm sorry. I forgot for a second that I don't want to take part in these kinds of discussions. Tesla, in this case. You can have your faith.

← PreviousPage 2 of 10Next →