Hacker Newsnew | past | comments | ask | show | jobs | submit | cbzehner's commentslogin

I find Rust and Typescript have a lot of helpful surface similarities that make them an easy pair of languages to switch between.

The fundamentals are very different but it’s a case of convergent evolution - and I’m happy to liberally sprinkle clone’s around my rust code


I used Fish for several years before switching over to nushell a few weeks ago.

Nushell takes the ideas behind Fish even further by incorporating types other than strings and adding more built-in functionality that’s useful for your average command-line user.

I doubt I’ll go back but both are great! Highly recommend Fish and Nushell!


Does nushell have the same kind of autocomplete? That’s what really keeps me using fish


No, at least not out of the box, on Nushell 0.39.0.

Just tried it and there's no

  - out-of-order tab completion
  - preview with left/right arrow completion
  - case-insensitive/smart-case completion


Incredible!

What was the hardest part?

What did you learn that you weren’t expecting?


The hardest part is debugging concurrency and weird scheduling bug. It's hard to debug because I can't reproduce it, which is quite frustrating. Over time, I found that making educated guesses, or running the code in my brain, it a lot more efficient than debugging every line of the code.


As someone who wrote and debugged a lot of concurrent code, here's another advice: log everything. Log as much as you could in the part where you think the bug is. Log every line that's run if you have to. You'll then skim through the log file looking for any unexpected patterns.

This approach works better than using a debugger, even on a single-core system, because these kinds of bugs tend to be hard to reproduce and take many iterations. You don't want it to hit a breakpoint a zillion times before it finally shows itself.

And another one, tangential to what you said. Read your code line by line and ask yourself "what would break if a context switch happens right here" for each line.


That's a very smart way of debugging concurrency. I did a lot of logging as well when I was doing debugging concurrency. Overtime once you got familar with the projects, I started to develope instincts on how everything fits together. That's when reading code line by line, making educated gusses start to become viable way of debugging concurrency.

But for complex projects, reading code or relying on instincts may not work alone as brain power run out of capacity. That's why logging helps a lot


You are right. Great work!

One somewhat related theoretical observation about concurrency is in some article by Dijkstra (I don't remember the reference right now): he says that debugging using traces (essentially printf) does not work for concurrency, since it is projecting multidimensional data (data present at the same time in multiple processes) unnecessarily linearized onto a single dimension (a sequence of printfs) and then trying to make sense of what is happening. It may not work, even if you print timestamps.

His view was to promote theoretical proofs of correctness of concurrent code, rather than debugging, but to me at least, this is much more difficult.


Very true, and not only do print statements inherently serialized threads, they also change the timing so significantly that probably your bug disappears anyway.


I would expect blazing fast in-memory logging with thread-id and time stamps, so timings aren't affected (much).


Back on the N64, I updated the bit of code that swapped threads to write, to a ring buffer, the outgoing/incoming PCs, thread IDs and clock. Found tons of unexpected issues. In another thread you can print that or save it to disk or whatever. Or just wait till it crashes and read memory for it. Found the last crash bug with it. Meanwhile, a colleague took it, and drew color coded bars on the screen so we could see exactly what was taking the time. Those were the days. =)


If you don’t mean to reveal it, what were you working at on the N64 ?


Ironically, trying to make a name for myself.


My tip: if you can pinpoint the place where the bug occurs, trigger a SIGSEGV there and run the entire thing under Valgrind. It shows you a lot of interesting data.


Related: I am in academia, and literally these are the questions that I ask prospective PhD students : what was one hard thing you understood in your area of interest? What was unexpected? And what was the final enlightenment when finally things clicked into place?


That's right!

After spending 5 years to write the OS, if you can spare 1-2 additional days to write down your experience, it'll be extra useful.


Yeah, I'll definitely share that


"What I really need is a droid that understands the binary language of moisture vaporators."

"Vaporators? Sir, my first job was programming binary loadlifters—very similar to your vaporators in most respects."

―Owen Lars and C-3PO


Or wind traps and dew collectors from Dune.


Please do. This has been a consistent pain point in my Rust web dev experience and even seeing some examples of how others structure solutions really helps!



If this isn't an ironic commentary on current events...


I'm out of the loop, what current events?


Probably the idea that you can pretend the truth is whatever you say it is, say whatever you want, never admit a mistake, and hundreds of millions of people will still back you up and continue to trust you. As seen by the president of the US ignoring election results, and countless other things done and said by that administration and their allies.


You realize this goes both ways. There are tons and tons of election irregularities. The presidential legal team has several lawsuits that are going forward and recounts going forward. There are literally tens of thousands of dead people who have voted in areas with very small margins.

So your statement ... you're making a truth. You're saying what you want it to be, even though there is tons and tons of evidence against that point (that the main stream media is intentionally ignoring and refusing to cover).

It goes both ways and our social psyche is now fragmented.


If you say so dude, and hey I have nothing against the using the legal process as it's intended. However there really is not tons of evidence, you haven't provided a shred of evidenced, nobody anywhere has produced any credible evidence of any of this. If they had the mainstream media would be all over it because any scandal is very good for their bottom line.

And I hope you'll retract your dangerous statements once the court cases are resolved and the recounts finished and not a single state is overturned.


I did a whole post on it here:

https://battlepenguin.com/politics/the-return-of-american-co...

There are a lot of irregularities and several states have already forced hand recounts because the margins are so close.

In PA and NV, they kicked out GOP observers. Why? Even if there is no foul play, that is a terrible thing to do. It. Looks. Bad. And it's illegal. Votes need to be tallied in front of both parties. They may have invalided hundreds of thousands of votes depending on a lawsuit.

Election fraud and voter fraud are very difficult to prove. America is no stranger to it (Remember Bush v Gore and Diabold voting machines?) But I think people had some hope the system was that corrupt. They were wrong, and America is.


You're just spewing garbage here.

The lawsuits in PA regarding kicking out GOP observers have been thrown out repeatedly, at this point the Trump campaign had to drop the claims about GOP observers not being allowed in from their lawsuits. Because there is zero basis to any of it.

The margins are close enough to recount, and nobody is arguing against a legal recount. But any reasonable person also recognizes that historically recounts don't change totals by tens of thousands of votes, so it is very unlikely to matter. The Florida results in the 2000 election you mention were much much closer than any state is in 2020.

Voter fraud is not at all difficult to prove. Many studies ballots have been analyzed in excruciating detail after elections, and surely will be done again this election. Voter fraud in the US is always extraordinarily rare. So far this election, one single case has been found in PA, and it was from a Trump supporter submitting a mail in ballot for his dead mother.

Not only are your claims untrue, they are so unfounded that there is hardly anything at all there to even refute https://www.usatoday.com/story/opinion/2020/11/13/trump-vote...


200 OK { errors: “This way lies madness” }


My understanding was that darcs fixed the model but had fundamental performance problems at _some scale_. I think pijul took the same concepts and tried to streamline them. And this rewrite does that...again?


I moved back to Austin, Texas when this all started. Family, breakfast tacos and more living space were all factors.


I moved out of Austin, Texas because it's pretty awful on rent these days... $2100 for a 1 BR in the Domain... oof.

I mostly lived around the city center in a house until the high rise condo developers came.


Fucking hell, I grew up in NW Hills, are those garbage Domain Apts really $2100 for a 1Br? That's absolutely bonkers!

I like visiting Austin, but after spending time in Boston and NYC Austin is flat out boring and self-centered.

It pains me, but for the past 2-3yrs I candidly refer to my home-town as quote "a shittier less cool version of LA that somehow manages to try harder".


That's where I'm looking at as well! Nothing has ever felt like home like Austin has for me.


You've just invented shipping containers.


I think GP has probably consciously drawn inspiration from shipping containers to solve a smaller-scale problem.


No, they’ve just invented recyclable containers with a large enough deposit to be worth reusing. Milk bottles are the classic example of this.

Ban plastic containers and you’re halfway there.


At a micro scale


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: