HNHacker News
TopNewBestAskShowJobs

catwell

1,287 karma · joined March 5, 2011

Software @ Finegrain.ai. Before: inch.fr (acquired by Septeo), eFounders (Hexa), Lima, Moodstocks (acquired by Google).

https://catwell.info

submissionscomments
catwell··on My love-hate relationship with LuaJIT (2015)
> 1-based indexing is just a silly departure from decades of ingrained thinking

This on only true for (not too old) programmers.

- Older programmers, taught pre-C, may remember that most languages were typically 1-based (Fortran, Pascal, Algol, Smalltalk...).

- Scientists usually use 1-based notation. I have avoided countless off-by-one by implementing papers in Lua. Matlab is also 1-based, probably because it is a language for mathematicians and scientists.

- In general, non-programmer tend to count from 1 and not 0.

> the only inheritance is prototype-based "classes" that are implemented via gross metatable hacking

If you need to you can implement non-prototypal object models, with metatables or with closures if you don't like them. My recommended object library is https://github.com/kikito/middleclass for people who want to write ojbect-oriented code (I usually don't).

> dictionaries masquerade as lists but can unintentionally become dictionaries if you mistakenly put a non-numeric key in them

I agree with this one, mostly. I would appreciate a purely sequential data structure ("list").

catwell··on My love-hate relationship with LuaJIT (2015)
Ravi is interesting and well known in the Lua community, but it is far from the performance of LuaJIT. I don't think a LLVM-based JIT compiler will reach that level of performance anytime soon.
catwell··on My love-hate relationship with LuaJIT (2015)
It is a CPU from RDC (Taiwanese manufacturer). It is 486-compatible but misses some instructions from later Pentium sets.
catwell··on My love-hate relationship with LuaJIT (2015)
Well, I have hit three different bugs in five years using LuaJIT, two of which I was the first to report. You cannot consider it as stable as, say, GCC.

Regarding your second point: Mike Pall had no intention to catch up completely. I don't know how much that has changed under CloudFlare leadership.

catwell··on My love-hate relationship with LuaJIT (2015)
I wrote that article, just found out it was on the front page of HN today.

The machine linked in the article can not even run the unmodified interpreter (or at least it could not at the time) because its CPU does not support the CMOV instruction.

Regarding the bugs: I do think most of them are in the JIT and not the interpreter. Even using a lower optimization level that the default fixes a lot of them.

catwell··on Why GitHub Finally Abandoned Its Bossless Workplace
No, it's almost the opposite. This kind of thing started happening for the same core reason they added management: because of the Tom Preston-Werner / Julie Ann Horvath scandal two years ago.

It made them understand the importance (and risk for the business) of such issues, so added HR and middle-management with a focus on them. As a side effect we ended up with things like this happening.

The people with an agenda are not random employees in a flat company here, it's the management.

catwell··on Plan9 from?
How hard would it be to make a preemptive Forth system? Not that much, I suppose. Or we could have hardware like GreenArray chips [1] with many cores (144) so that every application could have its own core and preemption would not even be necessary.

[1] The author of the article, Jeff Fox, worked for them. He died in 2011.

catwell··on Plan9 from?
Well, the view that we can do without "Operating Systems", or rather have the language be the operating system, is not new. It has always been pretty popular in the Lisp, Smalltalk, Forth... communities.

Daniel Ingalls famously wrote in 1981: "An operating system is a collection of things that don't fit into a language. There shouldn't be one." [1] A few years ago a paper argued that Plan 9 was basically trying to achieve that Smalltalk vision. [2]

And if you think about it, that view is extremely fashinable today, with the rise of unikernels [3]. Granted, they are not used for Desktop systems as of now, but who says they won't be in a few years.

[1] https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk....

[2] https://www.cl.cam.ac.uk/~srk31/research/papers/kell13operat...

[3] http://unikernel.org/

catwell··on A preview of Guile-Lua (rebirth), and some opinions
The link shows a blank page for me (Firefox, Arch Linux). I can read the article on the home page (https://nalaginrut.com).

It is interesting that you chose to implement Lua 5.2. Why choose 5.2 over 5.3 (the most recent version) or 5.1 (probably still the most used)?

As a Lua developer I really don't like what you did with ISSUE-1. In particular there could be some code that calls `foo()` explicitly on another object: `a.b.c.foo(d)`. This is perfectly well defined in Lua and can be used in some libraries that implement object models. It will not behave as expected with your design.

I am pretty happy to see articles mentioning both Lua and Scheme though. Both communities shared a developer room at FOSDEM last year, and hopefully we will this year too. [1]

[1] https://archive.fosdem.org/2016/schedule/room/k3201/

catwell··on Italy Quake Rescuers Ask Locals to Unlock their Wi-Fi
In France at least they made "insufficiently securing your home network" an offense. So you could argue that you have a guest network (or were hacked) but you would still not be in the clear.
catwell··on On Cybersecurity and Being Targeted
I have been using Gandi for 10 years and they are definitely great. I see no reason not to use them, except maybe that they usually aren't the cheapest.
catwell··on On Cybersecurity and Being Targeted
In theory, if the receiving end enforces TLS and if the sending end checks that the certificate is valid for the domain, you don't need to trust the DNS or the registrar. But nobody does that, and you still have to trust the sender.
catwell··on On Cybersecurity and Being Targeted
Also, TOTP is kind of secure if you never log into the website from the device that has the authenticator. Otherwise, it is pretty vulnerable to attacks that target the client.

IMO the real issue here is that almost all websites consider that email is a good way to verify the identity of someone when they want to reset their password, while in reality email is a terrible medium. Attacks on the DNS work, and a lot of SMTP traffic is still plaintext. The way to secure email is to encrypt and sign at endpoints but of course websites don't do this in the reset password flow.

catwell··on Notes on Distributed Systems for Young Bloods (2013)
That's kind of a digression, but the Lua GC is pretty simple (which is good) and not so efficient. The LuaJIT GC has some interesting features but sadly Mike Pall did not complete all of his plans for it.

What makes LuaJIT so efficient regarding the GC is that you can allocate memory that is not managed by it (using the FFI). You have to if you need to use a lot of memory anyway, since depending on the architecture GCd memory can be limited to as little as 1 GB.

catwell··on Notes on Distributed Systems for Young Bloods (2013)
To be honest when I said that I can was thinking about how less boxing occurs in (statically typed) functional languages. But like you and others said in the thread immutability can actually result in the creation of more objects, they just have different life cycles and properties that make the work of the GC easier.
catwell··on Notes on Distributed Systems for Young Bloods (2013)
Thank you for the explanation. I will read the links as well. Even if I don't use it, the design of Erlang is an interesting topic to study.
catwell··on Notes on Distributed Systems for Young Bloods (2013)
The issue is not really the VM, it's the language. GC performance is somehow tied to the number of objects it has to deal with.

Java code tends to be object-oriented and create a lot of objects. Functional code can create significantly fewer objects, so even though the Java world has the best GCs (like Azul C4) those other languages typically give their GCs less work to do. That also means that if you write code that does give a lot of work to the GC in a functional language it can certainly perform very poorly as well.

Erlang is probably different, afaik creating lots of (lightweight) processes is frequent in Erlang. I don't know how the Erlang GC works so I can't really comment on that.

catwell··on Notes on Distributed Systems for Young Bloods (2013)
Well, for Erlang it's pretty easy. Also including WhatsApp servers, Riak, a lot of router code...

The question is still interesting for the other two languages though.

catwell··on Apple Open-Sources its Compression Algorithm LZFSE
Or use 1-based programming languages :) I have implemented several algorithms from papers in Lua and that played in my favor more than once.
catwell··on New Cities
I am not sure we can make cities that are great to live in beyond a certain size. I don't know about the US, but in Europe smaller cities (less than one million citizen) do not have the systemic problems than larger cities have.

However, economic activity draws people and companies in, which generates more activity. We end up with over-populated cities like Paris, and the issues that come with them: ever-increasing housing prices, large suburbs, long commutes.

So I wonder if the main issue is really cities, or how to find a way to go from large monolithic cities to several reasonably-sized cities that cooperate. The technologies involved being transportation, remote work tools, etc.

Also, when I think about cities I like in Europe, an interesting point is that they are often built on the seashore (Lisbon, Copenhagen, Stockholm, Nice...).

catwell··on How to Make an RPG
I would say several things:

- Its small size (the PUC Lua codebase is about 15000 lines of C and compiles to about 250 kB). PUC Lua is the reference implementation of Lua, as opposed to e.g. LuaJIT.

- Its portability: PUC Lua is written in Clean C, the intersection of ANSI C and C++ 98. That makes it trivially portable to any architecture that matters in games.

- Its performance. PUC Lua is already faster than most popular scripting languages and uses less memory. If you need extra performance you can switch to LuaJIT and come close to C on a lot of codebases.

- The syntax is designed for data description, which makes it a very good language to implement DSLs for lots of things. Also the parser is very efficient so you can store data in Lua files.

- Coroutines. They let you propose an API to users (scripters) that appears synchronous but actually runs in an asynchronous fashion.

- The language is made to be embedded. Its C API is a central point of the design. The interpreter is reentrant so you can run several instances in threads without any problem.

All of this made Lua very popular in the game industry, along with its use in pretty famous games (initially Grim Fandango, then lots of others including World of Warcraft).

catwell··on How to Make an RPG
tl;dr This is a book about how to make a 2D JRPG in Lua (with a C++ engine). The source code of the engine and the art assets ship with the book.
catwell··on Canonical asks OVH to pay €1-2/mo/VPS. Else, prohibited to use the mark “Ubuntu”
Note that Octave Klaba is not French. His mother tongue is Polish. Also, he is not CEO of OVH anymore (he switched to a CTO position last year).
catwell··on Apple File System
Also, NTFS being a much better filesystem than HFS+, there was a lot less incentive to switch.
catwell··on Reimagining the future of routers
I have heard some companies have already started doing that a slightly different way, without the need for different hardware design. They buy several inexpensive routers that can only hold the top 10% of the routes (that represent 90% of the traffic) in memory, and a single expensive router which holds the whole table. Then they just set the expensive router as the default gateway on the unexpensive routers.

> I would never be in the top tier for bandwidth usage even if I was connected all day long

Maybe, but it probably doesn't depend on you unless you are your own AS. Routing tables do not contain individual IP addresses so if you are a "normal" ISP consumer chances are you will be in a block that is in the top 10%.

catwell··on Show HN: Dead Yet? – Keep an eye on dying startups
Some living startups are listed dead (Pinboard, bad URL), but some dead startups are listed alive as well.

For instance, L'Usine à Design is dead since 2013. They were a French company that made furniture, I bought a couch from them. Their office was on the same floor as Moodstocks, where I was working at the time, and after it closed a few angry customers came banging at our door to complain.

(The reason why the website thinks they are not dead is that the URL they used for the check is the URL of a news article announcing that they were dying!)

catwell··on Jolla C, a new Sailfish OS phone from Jolla
The way I understand it, it is a developer phone, something for people who do not have a Sailfish device yet and want to work on apps or the OS itself while the Intex device is in the works.
catwell··on Jolla C, a new Sailfish OS phone from Jolla
Signed up. I had backed the tablet but since it failed I never had an opportunity to try Jolla for real, this will be it.

I really think we need an alternative to the Android / iOS duopoly and I hope this is it.

catwell··on Programmers are not different, they need simple UIs
Yeah, as you can see the issue was that it is a different function, pushxGenericCommand(), which is used for LPUSHX, RPUSHX and LINSERT. For me having the same function for LPUSHX / RPUSHX and LINSERT does not make much sense (it uses different code depending on whether or not an argument is NULL anyway) so I had started by making LINSERT not rely on it.

My initial goal at the time was not to make LPUSHX and RPUSHX variadic, since like you said they are not used so much. It was actually to make LINSERT variadic, which can result in a significant performance boost compared to calling it several times.

Anyway, I will try to find the time to adapt it to the current code base.

catwell··on Programmers are not different, they need simple UIs
LPUSHX got my attention so I opened a pull request making it variadic (along with other commands) three years ago [1]. Of course since then the codebase changed and it can no longer be merged.

If there is still interest I could try to fix it, although I don't use Redis as much anymore and I have not looked at its code for a long time.

[1] https://github.com/antirez/redis/pull/1232

← PreviousPage 7 of 12Next →