HNHacker News
TopNewBestAskShowJobs

xavxav

1,035 karma · joined February 12, 2012

www.xav.io
submissionscomments
xavxav··on Typst, a new markup-based typesetting system, is now open source
Yes that's what I meant, I'm curious if the Typst api would allow equivalents of those packages.
xavxav··on Typst, a new markup-based typesetting system, is now open source
I was looking for a way to procrastinate on my thesis writing, maybe I'll convert it all to typst!

More seriously, I am really following this project closely, and now that it's open source I'd like to see if its possible to add the key libraries my field needs: mathpartir, and something like semantics? especially if typst can provide better syntax and errors!

xavxav··on C-rusted: The advantages of Rust, in C, without the disadvantages
My personal experience has shown me that static analysis of this kind does not scale for C, the complexity of showing just the memory safety of even simple programs grows astonishingly fast.

Proof overhead for memory safety can frequently be on the order of 5-10 lines of annotation per line of code.

xavxav··on Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again
not necessarily, depends on the embodied emissions in the replacement gear. It is also surprisingly hard to get any information on those. I tried seeing if there were estimates of the kg co2 in a modern CPU chip but I found nada
xavxav··on Value-Oriented Programming
Great article, and I agree that Mutable Value semantics are an underused sweet spot in the semantic space. I’ve been watching Val from afar with great interest.

I do think however that (safe) Rust can be said to have mutable value semantics, if you forget what a borrow “is” you find yourself exactly with a value-oriented language.

xavxav··on Building a legged robot in 80 days
Simulink / Stateflow and more generally 'synchronous programming languages' have a rich academic lineage and are particularly well adapted to safety-critical tasks.

These languages bring a lot of key guarantees that you can't (easily) get from more classical languages like bounded memory usage, hard real time guarantees, numerical properties, ability to prove theoretical properties about the model etc...

It's also not like having your code written as a text file would save you from using closed source proprietary compilers or languages (Ada, Ferrocene, various C distributions) for safety-critical software.

xavxav··on As a US Navy fighter pilot, I witnessed unidentified anomalous phenomena
> We already sent probe out of our Solar System.

To give an idea of the scale involved, Voyager 1 is only 0.058% of the way to the nearest star system, and that took 45 years. Granted it wasn't built for speed but given that the best hypothetical plans for a spaceship we have allow travel at ~.1c it'll take 50 years not counting acceleration / deceleration.

> Eventually probe will find planet with life. May be life is more abundant than we imagine now. May be not. Surely there will be protocols for the probe to investigate life. It's hard to imagine what those protocols would be. May be explore freely until certain technology advances are observed and then hide.

Even assuming that some set of automated probes have been travelling our galaxy for millions of years, and reached earth in the last few thousand years, where are they now? By what mechanism could they even be hiding? Every inch of the planet is being watched by satellites.

> My point is that developed civilization inevitably will expand its sphere of influence at speed limited by speed of light. Probably slower than that. But billion of years at 0.1c is still huge chunk of universe.

As an aside, I'm not sure you could meaningfully have one civilization spanning hundreds of millions of light years, the ends are just too spread out for there to be a single cohesive or web of cultures. Imagine if an email took longer than our entire species existence to reach you.

> Are we sure that no civilization born within this radius billion years ago?

I personally am certain that there are many other forms of life throughout our galaxy, and at least some of them must be technological. As much as would like for it to be false, I also believe there is no realistic mechanism for travel between stars and we are all effectively doomed to stay in our little corner of creation, maybe spying on each other through telescopes, assuming we can even spot a neighbor.

xavxav··on Bay 12 Games has made $7M from the Steam release of Dwarf Fortress
> Had DF monetized in 2006 instead of going free, and played the industry game as others do, I would not be surprised to see DF at $100M in 2023.

I don't DF would have existed then, it would be hard to see it gather the same community and the creators probably wouldn't have felt as free to explore their own ideas if they felt it needed to be commercially viable.

The thing that made DF's current commercial success is it's previously un-commercial approach. It's a true labor of love and that shows in every aspect of the game.

xavxav··on Make a Resume in LaTeX
Just checked your CV and it seems like the PDF version has several typos, specifically it says you are CTO at Meltwater when I think you meant at Pureskill.gg and is missing the entry for Seam

:)

xavxav··on AI is in danger of being swallowed up by copyright law
A half-serious thought I had is to allow AI to be trained on copyrighted materials but require all output to be public domain.

It doesn’t solve attribution, and you could get a sufficiently advanced ai to “launder” copyright but at least it would prevent those corporations from leveraging public works into copyrighted projects

xavxav··on Why we need to know LR and recursive descent parsing techniques
I like the idea of specifying a parser through a formal grammar but I think that current technology has a few pretty annoying-severe flaws.

  * Parser generator grammars are usually quite far from 'paper' versions of a formal grammar. The moment you have to deal with associativity/precedence or left-recursive rules the beautiful grammar tends to fall apart. 
  In theory most generators have mechanisms to help make this ergonomic but irl most grammars I've seen are totally illegible.

  * Error messages suck. I think this is actually a bigger issue, but parser generators have pretty poor error messages compared to even naive recursive descent parsers written with a library like megaparsec. There has been research on generating better error messages in generated parsers like menhir [1], but I haven't seen anyone apply this successfully and it requires you to manually annotate each error state with a message, and a real parser can easily have thousands, and they can change each time you update your grammar. 

  * Parser files are usually fairly illegible because they mix host language code with parser syntax and meta-variables. Some more modern libraries like Pest separate the two which I think is a net improvement.
Nevertheless, I hope that someone figures out a way to square the circle and frees us from handwriting parsers in all but the most exceptional cases.

[1] https://hal.inria.fr/hal-01248101/

xavxav··on 26 programming languages in 25 days, Part 2: Reflections on language design
I explicitly ignored codata/coinduction as they are complex and rather niche. Even so, they come with their own notion of 'termination' (progress / wfo) and don't magically let you write random non-terminating programs.

Depending on what you want to achieve there are plenty of tricks and techniques to encode a divergent program in a sound dependent-type theory, but the best approach to use will depend on the problem statement.

xavxav··on 26 programming languages in 25 days, Part 2: Reflections on language design
Both, but almost more importantly the languages themselves are all strictly terminating.

Long story short, these languages are based on the “Howard-Curry isomorphism” which says that we can view type signatures as theorems and programs with that signature proofs of that theorem.

A program which runs forever is a proof of false (you could see it as saying “after infinity time I’ll have your answer I swear”). So these languages are designed to prevent that from being possible.

xavxav··on How long would society last during a total grid collapse?
I think this is what’s usually referred to as a “blackstart capacity”, and normally grid operators pay/ensure that certain operators maintain that capability.

The issue is that I imagine that just keeping an idle natural gas generator large enough for your pipeline + shipping terminal + whatever is not a trivial cost.

xavxav··on A guide to error handling in Rust
I know that this is a common wish, but anonymous sum types have pretty catastrophic impacts on type checking and lead to all sorts of bizarre corner cases like the following:

  let a = if cond {
    1 
  } else {
    1.0
  };
  
  a + 3
Now, the error would be pushed to the `+` operator because there isn't an `Add` for `f32 | u32`. Granted, this is a trivial example, and a programmer can easily see through it, but in general this can get very overwhelming and cause errors to leave their 'root cause'.
xavxav··on NightWare helps disrupt nightmares for those with PTSD
I don't a judge will care much about your argument that a sum is different from an average for patent infringement considerations.
xavxav··on Rust 1.65.0
For inlining in general, I think the wikipedia article is good https://en.wikipedia.org/wiki/Inline_expansion.

The reason it's so important is that inlining synergises with other optimizations, its often run before or after other passes like constant propagation. Consider something like:

  fn add(x : usize, y : usize) -> usize { x + y }

  fn main() {
    add(5, 1)
  }
Without inlining we can't easily optimize the code of `main`. However, if we inline `add` into main, constant propagation will then directly see `5 + 1` and optimize that into `6`.
xavxav··on Rust 1.65.0
While GATs are undeniably cool, I think I'm actually most excited by the enabling of MIR inlining. Rust level optimizations have a real potential to increase performance and decrease compilation times, and inlining is one of the most important primitives for that.
xavxav··on Sile: A Modern Rewrite of TeX
It's damning that there no truly functional grammar or spellchecker for latex, even ignoring crazy things that can be done with macros.

If some billionaire wanted to 'move the needle' and change society for the better I think building a truly better latex would be worth it. Each year some of the most brilliant people in the world sacrifice on the altar of latex, that could instead be spent on more productive research.

xavxav··on Linker, can you spare a meg? (2021)
I doubt it hurt performance, self-modifying code must play havoc on all the modern CPU caches, branch prediction, instruction decoding etc… A jit makes it worthwhile by doing it for hot paths for which the payoff outweighs this cost (or attempts to).
xavxav··on I help seniors with technology issues
The digital divide is a major problem today, and manifests all over the place, whether it’s spyware like this laptop, issues with phones or just interacting with service providers.

I recently tried helping my aunt switch internet providers to one 50% cheaper, I called, set everything up, it was all finalized they just needed to come switch the connection over. After I left, she made a call to the company to switch the appointment and ended up getting the contract cancelled, then stuck in limbo and a month later I still haven’t been able to get it fixed. It’s impressive how if someone doesn’t know the right phrases and things to say, you end up in digital purgatory where no one can help you.

xavxav··on LaTeX Makes Me Angry
> If I could, I would write in Sublime Text, because it's faster. However, no Sublime Text plugin for LaTeX exists.

I'm using the Latex and LatexTools packagest, so I don't follow your point. It's pretty good and can also be set up to properly autocomplete `\cite` and `\ref` in multi-file projects quite easily.

xavxav··on Transmission 4.0.0 beta 1
> The project is much more responsive to bug reports and code submissions than it has been in the past.

Cool to see community listed as a feature up there with the tech stuff

xavxav··on Ask HN: Has the Apple Silicon excessive disk read/write issue been fixed?
M1 Pro

  === START OF SMART DATA SECTION ===
  SMART overall-health self-assessment test result: PASSED

  SMART/Health Information (NVMe Log 0x02)
  Critical Warning:                   0x00
  Temperature:                        28 Celsius
  Available Spare:                    100%
  Available Spare Threshold:          99%
  Percentage Used:                    0%
  Data Units Read:                    14,683,648 [7.51 TB]
  Data Units Written:                 15,448,997 [7.90 TB]
  Host Read Commands:                 198,962,886
  Host Write Commands:                199,550,695
  Controller Busy Time:               0
  Power Cycles:                       172
  Power On Hours:                     196
  Unsafe Shutdowns:                   15
  Media and Data Integrity Errors:    0
  Error Information Log Entries:      0
xavxav··on Why OCaml?
Not really, it's more that I regularly make typos in all forms of writing (even handwritten). It's not usually misspellings but rather whole lexemes that go missing or are swapped.

fwiw, I TA a course taught (partially) in OCaml and work regularly with a large OCaml project as part of my thesis.

Parser generator errors are just a personal pet peeve of mine, I grew up with (mega)parsec (Haskell), where decent errors are out-of-the-box and great ones are easy.

xavxav··on Why OCaml?
I'll try to find an example of the syntax error I was mentioning, but I regularly trip up the parser with dumb mistakes which cause it to give completely useless errors.

> Syntax errors are caught well by the parser which tells you exactly where they are.

They aren't necessarily caused where the actual error is, just wherever the parser gets stuck, and the error it produces is usually not reflective of the human thought process that went in, but rather the automata's state.

xavxav··on Why OCaml?
OCaml is an impressive language on many fronts: compile time, speed, memory usage, but then is almost crippled beyond usage by a few unfortunate decisions / (lack of) features:

- Dependency management, despite progress `opam` is hopeless brittle because no one uses lock files, good luck building a project that's more than 3 months old. Additionally, by default everything is installed into a global 'switch' and only one version of each package can exist in it.

- Build tooling: things are finally improving with `dune`, but the amount of packages that are running hyper-complex Makefile based build systems is incredibly frustrating. It can be very difficult to add a dependency or change the layout of these projects if you aren't an expert in arcane Make sigils.

- Error messages: again, finally improving, but the number of times I've gotten errors like "line 78 Syntax Error"... I know that parser generators are appealing academically / intellectually but there's a reason major industrial compilers use recursive descent.

- Documentation: Seemingly non-existent for most packages and the tooling is quite poor compared to peer languages (Haskell, Rust).

- More controversially, I think that modules are a worse solution in practice than typeclasses / traits. The automatic instance resolution coherence brings is a huge ergonomics win, and it also allows for more ecosystem wide collaboration in practice. I know that modular implicits are supposed to bring the 'best of both' but that doesn't even exist yet.

None of the problems above are unfixable but they collaborate to make working in OCaml a very frustrating experience for me, even worse because through them I can see what is actually a quite nice language.

xavxav··on Why OCaml?
> INRIA university

tiny nit, but INRIA is not a university but rather a national network of labs.

xavxav··on It's time to halt starting any new projects in C/C++
Yea but it’s not really useable in practice as it heavily relies on nesting allocations in closures to simulate “generative lifetimes”. It’s a research artifact, not meant for serious usage. Instead, I would recommend using something like https://crates.io/crates/qcell, which works on similar principles.
xavxav··on It's time to halt starting any new projects in C/C++
I agree that debugging bad macros is annoying, especially proc-macros but that’s not comparable since by their very nature proc macros are no more powerful than hand written code. They cannot create new semantics, at best they can add new syntax sugar for things that already exist in the language.
← PreviousPage 3 of 5Next →