Better HN
topnewbestaskshowjobs
Log inSign up

GrumpySloth

4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions

Submissions

comment 4y ago · link · parent

Paradoxically, I've never brought myself to like Lem's science-fiction books, but enjoyed his two non-science-fiction books (one of them even non-fiction):

1. Hospital of the Transfiguration: <https://www.goodreads.com/book/show/251632.Hospital_of_the_T...>

2. Highcastle: A Remembrance: <https://www.goodreads.com/book/show/251630.Highcastle>

comment 4y ago · link · parent

I don't have a formal CS career either. In one of the other comments someone wrote they read it being a high school dropout. Different people like different things. Note also that submission author studied chemistry, so they did get their fair share of training in mathematics.

comment 4y ago · link · parent

I'm currently going through TAOCP[1]. So far, seems pretty good (although I found one mistake in an exercise).

Also, I can never recommend Computer Systems: A Programmer's Perspective[1] enough. (Also features a rare mistakes in an exercise or two, but that's detail.)

And for network protocols, Comer's Internetworking with TCP/IP[3] was just great (you only need volume 1). I've read Stevens' books on socket and IPC programming in Unix, but didn't like them, so I also stayed away from TCP/IP Illustrated, but others have different opinions.

[1]: <https://www-cs-faculty.stanford.edu/~knuth/taocp.html>

[2]: <https://www.csapp.cs.cmu.edu/>

[3]: <https://www.pearson.com/us/higher-education/program/Comer-In...>

comment 4y ago · link · parent

If you have an anti-glare screen, that's not an issue.

comment 4y ago · link · parent

Ok, now it's my turn: C++ would be a clear loss on net. Anyone thinking otherwise, even if they are Linux developers, are wrong. Now that was productive.

comment 4y ago · link · parent

It looks like the Wikipedia app for iPad.

comment 4y ago · link · parent

This reminds me of the beginning of "The Da Vinci Code".

comment 4y ago · link · parent

I was in Tallinn last September and saw a couple of these. They're pretty cute. One thing that bugged me was that when one of them crosses a street (using a pedestrian crossing), when it detects a car approaching, when it's in the middle of the crossing, it stops and goes back to the pavement it was on originally, instead of continuing to move forward, which would take either the same or even less time. What's the logic here?

comment 4y ago · link · parent

A bit OT: what kind of performance do you normally expect from OCaml? I looked at the Prime Sieve challenge[1] recently and with the current submissions the Standard ML solution is 3 times faster than the OCaml one. I've also spent some time optimizing this SML solution and got it several times faster still. With a bit more work I thinkg I could get it up to the speed of the fastest C solution. It's compiled with MLton. From that POV OCaml is a bit disappointing, since I've also viewed SML as a "hipster language" that hasn't had that much money put into it, while OCaml saw quite a bit more development, so I would expect the OCaml compiler to be able to produce better code. I've briefly looked at the OCaml code, but I don't know OCaml as much as SML, so can't really say what may be the issue in the OCaml case.

[1]: <https://plummerssoftwarellc.github.io/PrimeView/report?id=rb...>

[2]: <https://github.com/PlummersSoftwareLLC/Primes>

comment 4y ago · link · parent

Please don't post insinuations about astroturfing, shilling, brigading, foreign agents and the like. It degrades discussion and is usually mistaken.

https://news.ycombinator.com/newsguidelines.html

comment 4y ago · link · parent

Plants aren't responsible for photosynthesis. They just photosynthesise. Fungi aren't responsible for decomposition. They just decompose.

Saying they are "responsible" for those things is like saying that a river is responsible for flowing or the Earth is responsible for rotating.

comment 4y ago · link · parent

> Once you've hit 80 you probably should look at growing horizontally.

To many it happens after hitting 40.

comment 4y ago · link · parent

I'm definitely calling it that starting today.

comment 4y ago · link · parent

Julia is designed with interactive use and REPL in mind. Java is designed with enterprise software written by large teams and IDEs in mind. The first one, among other things, leads to valuing terseness. The seconds leads to valuing verbosity. I wouldn't want to deal with the usual Java boilerplate in an interactive session.

comment 4y ago · link · parent

Actually, I've recently watched a talk by Guy Steele where he makes a case for tail call elimination being essential for object orientation: <https://www.youtube.com/watch?v=0hlBkQ5DjaY>. He demonstrates how tail call elimination enables better separation of concerns, allowing you to write code where objects don't need to "peek" into one another.

Another non-functional application of tail call elimination is finite state machines. Writing them as functions calling the next state in tail call position is very elegant, legible and efficient.

comment 5y ago · link · parent

It's a convention. Same with small-o and e.g. Taylor polynomials in first-year calculus. Writing e.g. sin(x) = sin(a) + (x - a)cos(a) + o(x - a). We used an equals sign, even though the meaning of this string of characters is "belonging to a class" and not "being equal". It's kind of convenient for long calculations.

comment 5y ago · link · parent

Cursor movement as well.

comment 5y ago · link · parent

> No, that's no true. Tracing GC is mainly O(f(live stuff)), not O(f(dead stuff)), so there is basically no problem making lot's of garbage if you don't have any exotic latency requirements.

That's true for copying generational garbage collectors. You only need to copy the live stuff and forget everything else. But in e.g. a mark-sweep collector, sweeping dead stuff takes time. In particular, e.g. Chromium's Oilpan can take a long time in the sweeping phase, when there are lot of dead objects.

But when there are a lot of microallocations, you also have a lot of live objects, which could otherwise be just a single object in the case of e.g. big arrays.

>> Another reason is eliminating unnecessary pointer indirection, which helps make sure that instead of loading data with two MOVs from memory polluting the cache, you need only one.

> Uh, that is locality, what I started with, no?

Hmm, seems I highlighted the wrong aspect. It's not just locality, but also size of the data you're dealing with. Those pointers take space. Another aspect of it is that arrays of unboxed elements have more predictable access patterns. Iterating over an array of unboxed elements is friendly to cache prefetching. CPUs recognize this (linear) pattern. With boxed elements and a compacting garbage collector locality may be fine, i.e. elements of the array may be close in memory, but the order in which you fetch elements is pretty random. When the cumulative size of the elements of the array is significantly larger than 64 bytes (the usual size of a cache line), then you're going to be prefetching the wrong regions of the array. There are situations where the order is going to be right, because e.g. the elements were created in the same order in which they are in the array, but that will be destroyed after some sorting, filtering or whatever.

comment 5y ago · link · parent

> The big reason for "value types" is controlling spacial locality in memory, not GCs being bad per-se.

Spacial locality is one reason. Another very important reason is not generating unnecessary garbage. If you have a lot of microallocations, then your program is going to be slow regardless of you using manual memory management, RAII or a tracing GC. There is just a lot more stuff to do. With manual memory management, you're just going to call free() a lot (using big forward linked lists and freeing them with a function iterating over them, calling free() on each node? yikes). With RAII you're going to spend a lot of time in destructors due to an avalanche of objects freeing the objects they own (structs holding unique_ptr/shared_ptr to structs holding unique_ptr/shared_ptr to...? std::vector<std::string>/std::vector<std::unique_ptr>? these are all antipatterns when it comes to performance). With GC, you're going to have long GC pauses, because the GC needs to traverse a bigger graph of pointers (deep/broad trees of heap allocated objects? arrays of boxed objects? yikes).

Another reason is eliminating unnecessary pointer indirection, which helps make sure that instead of loading data with two MOVs from memory polluting the cache, you need only one.

For my current project, I use arenas to opt-out of RAII and have just a couple points in my project where memory is freed, instantly in one go. Needless to say, I don't use arrays of boxed elements. It's working great for me. Not only is it faster, but also simpler to understand and I don't need to fight with the borrow-checker as much as in normal (RAII) Rust, because my objects are grouped into longer lifetimes, so I don't need to think about separate lifetimes for every distinct little object.

That said, I'm spending some time gathering ideas for a toy language I'd design for myself to write an OS from the kernel up to userspace in, and I'm leaning towards a GC-based design that relies a lot on value types. One way or another, allocating a lot of little objects is stupid, because in every scenario it makes your program slower and, code quality-wise, at best it doesn't make a difference, but a lot of times it makes your code harder to reason about, because now a lot of things are remote to the place in code you're thinking about at any given time.

comment 5y ago · link · parent

Agreed, though to be fair the sentence is a bit obtuse in that regard. The only clear indicator this remark applies to "philosophical influence" (Heidegger) and not Arendt is the gender of the pronoun (him), which can be easily missed, as gendered pronouns are more often noise than signal.

comment 5y ago · link · parent

I haven't used C#, so don't really know, but doesn't Visual Studio have a great debugger for C# with things like custom visualizers? Looking from the outside, it seemed to me that for C# the Visual Studio debugger has an edge over the competition.

comment 5y ago · link · parent

(I'm not the author. Only the graph looked familiar in style, so I guessed graphviz and verified looking at the source code of the website.)

comment 5y ago · link · parent

  <!-- Generated by graphviz version 2.40.1 (20161225.0304)
   -->
You can use the dot(1) command for that, with output set to SVG in this case (-Tsvg).

comment 5y ago · link · parent

Yes. I once wrote a tool which spends a lot of time traversing the filesystem and to my surprise in one scenario most of its time is spent on-CPU (!) in kernel-mode in the readdir_r(2) syscall implementation. I still haven't dived into what it's doing on the CPU, but it sure is interesting.

comment 5y ago · link · parent

I pay for Netflix and pirate what is available on Netflix, because my local video player has much better hardware acceleration than web browsers, is more efficient and as a byproduct gives me better video quality.

comment 5y ago · link · parent

Why awful?

comment 5y ago · link · parent

> You can launch into a WSL shell in seconds without having to wait for a VM to spin up.

Serious question: how long does it take to spin up a VM on Windows then? Does it take seconds?

(Not disputing your other points.)

comment 5y ago · link · parent

Why do you rule out drugs making people addicted? If some drugs can alter your consciousness, as they clearly do, why wouldn't some of them be able to get you addicted to them?

To be clear, I do agree that a lot of cases of addiction will start with emotional problems getting people into prolonged consumption. However, emotional problems can also get people into obsessive running, yoga or whatever. But after getting their mind straight people generally don't need to be careful and abstain from running due to risk of a relapse of obsessive running --- contrast this with drugs, most prominently alcohol. Risk of relapse only happens with drugs, because it seems to my layman mind that it's not the emotional problems that get people addicted, but substance abuse. Emotional problems get people into substance abuse, but it's the substance that creates addiction, not the emotional problems, because see example with running.

And there are other triggers that get people into irresponsible consumption (societal expectations, such as in military[1]) that aren't emotional problems. They nonetheless often end in addiction, because of what the substance is doing to people's brains.

[1]: I'm talking about what I've heard from my father from Soviet era military about nicotine. I don't know what it looks like now/in other countries.

comment 5y ago · link · parent

It may be a symptom, but it may also be its own cause. Chemical addiction is a thing and various drugs have various levels of risk or chemical addiction. Alcohol, nicotine, cocaine, heroine - you can get addicted to them without any emotional problems.

comment 5y ago · link · parent

Wikipedia pages are also subject to PR fights and lobbying: <https://news.ycombinator.com/item?id=22653716>
1
404142
55