HNHacker News
TopNewBestAskShowJobs

jpfr

1,707 karma · joined March 5, 2014

submissionscomments
jpfr··on Depressing and faintly terrifying days for the C standard [pdf]
If desired, I can comment your document over a private channel. In that case, please give a short heads-up when ready.

Note that I am not directly affiliated with WG14. So take my comments with a grain of salt.

jpfr··on Depressing and faintly terrifying days for the C standard [pdf]
You are invited to bring forward concrete proposals for changes to the C standard in the relevant committee.

http://www.open-std.org/jtc1/sc22/wg14/

Since UB allows the compiler to do anything in those situations, we can reduce the amount of UB without breaking existing “legal” code. By actually defining more behavior.

If a proposal is reasonable needs to be discussed in the standardization committee. All other discussions are a nice hobby. But eventually moot.

jpfr··on Lightweight Concurrency in Lua
In addition to this, Andy is performing wonders for Guile Scheme.

It is rare to see such lucid communication and such a clean commit history for hard technical development.

http://git.savannah.gnu.org/cgit/guile.git/log/

https://lists.gnu.org/archive/html/guile-devel/2018-05/msg00...

In a few years, all the cool kids will switch from Graal to Guile for language development.

jpfr··on Drop Table Companies Ltd
Obligatory xkcd: https://xkcd.com/327/
jpfr··on Fuchsia is not Linux
A huge portion of Linux is drivers and support for different processor architectures. Yes, development was chaotic in the nineties and the code showed. But a lot of engineering effort went into making the core really nice.

https://unix.stackexchange.com/a/223763

With regards to POSIX, it is amazing how well this API is holding up. There are quite a few implementions from GNU, BSDs, Microsoft (at least partial support in MSVC) and a few others (e.g. musl). So POSIX support is a given on most systems. Why replace it with something that breaks existing code?

https://www.musl-libc.org/faq.html

Not to say there is no bloat. But some bloat is the patina that all succesful systems take on over time. Is the bloat small enough to be managed and/or contained? I say yes.

jpfr··on Ask HN: What are the best MOOCs you've taken?
Gilbert Strang is a lengendary teacher.

In addition to the other Gilbert Strang ODE courses, this one comes with videos for numerical solutions. From the inventor of Matlab himself.

jpfr··on Ask HN: What are the best MOOCs you've taken?
MIT OCW contains quite a few true gems. These lectures will still be worth watching 100 years from now.

- Differential Equations from 2015: https://ocw.mit.edu/resources/res-18-009-learn-differential-...

- The original SICP recordings from 1986: https://ocw.mit.edu/courses/electrical-engineering-and-compu...

jpfr··on DIY makers who build their own watches
Nobody cares about ETA at this point.

The patents and registered designs of ETA movements have expired. You can buy exact clones of ETA movements legally.

ETA clones by Sellita and Soprod are said to be better than the original. Sea-Gull (and other Chinese) aren't bad either. Especially for the price...

jpfr··on Non-Convex Optimization for Machine Learning
> Sure, such a Lipschitz bound could give us some help on lower bounds on the objective function value but for those bounds we would need some constraints! Then at least in principle, we are back to the Kuhn-Tucker conditions again.

You don't need constraints for the bounds. That's the beauty of it.

The idea is to sample from the domain and use Lipschitz bounds (or a semi-metric in the cited paper) to upper-bound the target function via the distance to the samples. The question is how take samples in a principled way that garuantees a "good" speed of convergence.

There is no free lunch. So some assumptions have to be made on the non-convex target function. However, a semi-metric around the optimizer is much weaker assumption than a Lipschitz constant. The function doesn't even have to be continuous!

Of course performance is a lot slower than, say, linear programming. But this is non-convex optimization, a much harder problem.

jpfr··on Some obscure C features
> I also haven't seen one large-scale network-facing C project written using reasonable development practices (i.e. not absurdly expensive formal verification) that hasn't had some sort of terrible remote code execution vulnerability.

This has gotten a lot better with static code analysis (clang-analyzer, Coverity, ...) and whitebox-fuzzing (libfuzzer, afl, ...). Both simply point you to the bugs and don't require a formal spec.

Together with Valgrind, these tools have revolutionized C programming for me.

jpfr··on Non-Convex Optimization for Machine Learning
Can you explain where Kuhn-Tucker enters the picture here? Non-convex optimization problems do not necessarily define constraints for the domain.

Most non-convex optimization with bounds for the convergence speed exploits on some sort of structure. For example Lipschitz bounds for the gradient. There is some recent work that requires only a semi-metric around the optimizer. That opens up a large class of functions that could not be efficiently optimized before.

http://papers.nips.cc/paper/4304-optimistic-optimization-of-...

jpfr··on Non-Convex Optimization for Machine Learning
This was just released as part of the now series for machine learning. They usually publish superb reference material. Research that is foundational and/or has become a stable body of work, but is recent enough to be interesting.

Read these and you are on the edge of what is currently happening.

http://www.nowpublishers.com/MAL

jpfr··on Sussman anomaly
Convex optimization and its mixed-integer counterparts have developed amazing results. But not all planning problems fit this framework.

There is an entire community dealing with "AI planning". They try to find action-sequences leading to a desired outcome. Every action is defined by preconditions and effects. Most of the benchmark cannot even be sensibly formulated in terms of a mixed-integer optimization problem.

This seminal paper is a good entry-point to the field: http://www.jair.org/media/1705/live-1705-2731-jair.pdf

A bit of background research would do good before calling the problem at the center of a very active community "childish".

jpfr··on A Short Introduction to Implicit Computational Complexity [pdf]
What a pity that all the references are missing [?].
jpfr··on The Case for Writing a Kernel in Rust [pdf]
The easiest way forward for a rust kernel is not to start from scratch, but to port Minix3. Minix is an open source micro-kernel somewhat similar to QNX. The kernel itself is on the order of 4000 lines of code. [1] Though small, Minix has quite a long history, is super-stable and looks like a sweet spot in kernel development.

The kernel could be ported piecemeal while always being able to boot during the transition. Similar to how remacs is slowly porting emacs over to rust [2].

And on top of that, you can use the rump kernel approach to run the device drivers, TCP/IP, etc. from NetBSD. So you immediately get a fully functional OS.

[1] http://www.minix3.org/

[2] https://github.com/Wilfred/remacs

jpfr··on What's the ultimate way to defy depression, disease and early death? Exercise
Sure, eating better has a huge impact. But you miss the main argument why physical training helps in weight loss: Physical training increaes your resting metabolic rate by ~10%. https://www.ncbi.nlm.nih.gov/pubmed/11283427

Since you are not doing sports 95% of the time, this has a lot of leverage. And you can build muscle with 30min of training per day easily.

Also, you please check whether you mean kilocalories when you say calories.

jpfr··on Chrony: Comparison of NTP implementations
Just for completeness, how would ntpsec fare in this comparison?

I know ntpsec is a somewhat questionable fork. But the refactoring work itself can't be all bad...

jpfr··on Anko SQLite, a library to simplify working with SQLite on Android
Which are "these" libraries and what do they do?

Leaving some technicalities aside, SQLite is SQL. So I guess we're not talking the same here.

jpfr··on Mongoose OS – An Open Source Operating System for the Internet of Things
GPL does not allow static binaries from both GPLed code and commercial code.

A workaround is a plugin mechanism with dynamic loading of .dll or .so libraries. But that won't fly on a microcontroller.

jpfr··on Undefined Behavior in 2017
I wonder why he mentions this TIS interpreter but not the development of complete semantics for C and specifically the k framework (https://github.com/kframework/c-semantics).

Afaik, kcc is also really good at finding undefined behavior. Regehr even wrote about it in the past (https://blog.regehr.org/archives/523).

jpfr··on Convincing C programmers to switch to C++: A look at human behavior (2016)
The kcc compiler is really good at being predicatable. A formal semantics of the language gives warnings whenever undefined behavior occurs.

https://github.com/kframework/c-semantics

jpfr··on Convincing C programmers to switch to C++: A look at human behavior (2016)
The talk starts off with

    “If you’re arguing, you’re losing.” — Mike Thomas
No, no, no.

A shouting match doesn't help anybody. A civilized exchange of arguments does. And the establishment of evaluation criteria is a very good basis for listening to the other.

The not-arguing approach often times results in "let me show the merits of my technology without listening to your requirements / evaluation criteria".

C is different from C++ because it targets different use cases. So it needs to be evaluation in the context of use cases. End of story.

jpfr··on J one-page interpreter fragment (1992)
The code was written on paper. Without the usual compile/debug cycles during development.

The amazing part is how little cleanup work is required to make the code work. It's an entire programming language after all!

jpfr··on Angela Merkel: Europe must take ‘our fate’ into own hands
The US spends more on military than the next 8 countries combined. A quarter of that would be enough for NATO, which is for defense only, now that the Cold War is over.

Europeans don't want the US playing global super power. They don't need it. And they ain't paying for it.

jpfr··on Angela Merkel: Europe must take ‘our fate’ into own hands
Nah, NATO is required for that to work. It's like a group ticket. The more you are, the cheaper it gets for each individual. NATO only needs to collectively have more capability than the biggest external threat. More than that is overspending.

And the US are not paying $$ for anybodys army. And they know very well how to use their own capabilities outside of NATO and for their own interests.

jpfr··on Angela Merkel: Europe must take ‘our fate’ into own hands
Assume European countries were all spending 2% of GDP for military capabilities within NATO. What exactly would that buy them?

More military interventions with more refugees arriving at European borders?

There is basically no real threat to European countries atm. Russia is heckling a bit in Ukraine. Supplying Kalashnikovs to separatists and such. But in general, Russia is retreating. With Montenegro joining NATO and things going bad in Syria, Russia is losing access to the Mediterranean sea. And they run out of money quickly!

If things go wrong, special forces (a few hundred men) and French atomic missiles pose enough of a threat for rogue dictators. The large countries can't afford a war, because economic ties are too strong.

Military spending in Europe is exactly where it needs to be. Low. Humanitarian help throughout the world and keeping the inner stability of society (social security, health-care, retirement, ...) gives a lot more bang for the buck. (pun intended)

jpfr··on My Struggles with Rust
If it is something that OCaml, Haskell and Lisp are not lacking, it is books written about them. We can argue on technical points. But the existence of documentation is a non-issue for all of these languages.

https://ocaml.org/learn/books.html

https://wiki.haskell.org/Books

http://lisp-lang.org/books/

It could well be, that these books are written for experienced programmers who don't need basic concepts (control flow, object orientation, etc.) explained. But that was not the point.

The absence of an easy road for these langauges is because they need to teach some powerful abstractions first that have no equivalence in Python, Java or C.

jpfr··on My Struggles with Rust
These are the exact same complaints of students learning to program for the first time.

Have you tried functional programmng? Lisp? Ocaml? The complaints of newbie functional programmers are also nearly the same.

The "struggle" is necessary. If there is no struggle, there is no learning of fundamentally new approaches you are not yet comfortable with.

See it as part of the training regimen that lets people emerge as stronger programmers on the other side.

jpfr··on LuaJIT 2.0.5 and 2.1.0-beta3 released

    A function that tests for something involving its arguments
    is called a predicate and usually ends in p or -p.
http://www.cliki.net/Naming+conventions
jpfr··on Emacs 25.2 released
This is the branch to watch for guile-elisp: http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-elisp

Last thing I heard was that Guile-Elisp (and by consequence Guile-Emacs) is working, but very slow. That can be fixed but requires work. Also, Emacs internally uses a different string representation from Guile. This makes the transition between languages tough and some more glue is required.

IMHO Guile-Emacs is "nearly there". I.e. with just a little more work it could have enough momentum and attract developers to be on the trajectory of becoming the default elisp implementation in the long term.

Having the new Guile 2.2 VM drive Emacs would definitely improve things. And the C-codebase could become considerably smaller and cleaner.

← PreviousPage 7 of 11Next →