HNHacker News
TopNewBestAskShowJobs

silentbicycle

11,689 karma · joined June 13, 2008

Bicycles. Sourdough bread. Puzzles, of all kinds. Tea and word games. Mountain Goats live shows.

Email: At gmail, with the account name vokes DOT s. My name is Scott, and I cook a mean frittata.

http://github.com/silentbicycle http://twitter.com/silentbicycle

Declarative real time programming NOW!

http://hackernewsers.com/users/silentbicycle.html

submissionscomments
silentbicycle··on Greatest: C unit testing library in one file
I wrote greatest because minunit doesn't provide any of the infrastructure that nearly every test runner grows eventually, in some ad hoc way. Halting after the first error is just not good enough after projects grow beyond a certain size. Also, being able to run just specific suite(s) or test(s) by name patterns from the command line really speeds up one's workflow.

I still wanted something as straightforward to use as minunit, though. Not knocking it. I'd rather use minunit than something that imposed its own architectural opinions on my projects, or consumed resources already in short supply. Also, I make a lot of small C utilities and libraries, and having to define a "project" just to have tests adds a bit too much friction.

(I wrote a bit more about that here: http://spin.atomicobject.com/2013/07/31/greatest-c-testing-e... )

silentbicycle··on Comparing the Cost of Different Multiple-return Techniques in C
The code for the benchmarks is up, if you want to investigate: https://github.com/atomicobject/multiple_return_in_c_benchma...
silentbicycle··on Comparing the Cost of Different Multiple-return Techniques in C
The code is up: https://github.com/atomicobject/multiple_return_in_c_benchma...
silentbicycle··on Comparing the Cost of Different Multiple-return Techniques in C
Yeah, I'm planning on posting the benchmark source, but between Christmas, a rather nasty ice storm, and a bad cold, I'm a bit behind. It will be up in a few days.
silentbicycle··on Comparing the Cost of Different Multiple-return Techniques in C
That's why I mentioned compiling SML to C, actually. :) It's worth evaluating costs for what generated C looks like when something else (SML, Chicken Scheme, etc.) is compiling its constructs to C, just as much as it is for what people will typically write.
silentbicycle··on Comparing the Cost of Different Multiple-return Techniques in C
Author of the top post, here. Two of my favorite C books are David Hanson's _C Interfaces and Implementations_ and Peter van der Linden's _Expert C Programming: Deep C Secrets_.

The former is ostensibly about designing reusable modules for data structures (e.g. ring buffers), but also contains a lot of wisdom about API design, particularly how to make the most of what little API design tools C gives you. The latter is all over the place, from funny anecdotes about compiler bugs and programming contests to all kinds of useful C information that is too advanced for an intro book on C-the-language, but way too practical for most books on a specific domain: valuable details about linkers, symbol visibility, different kinds of allocation, and the memory hierarchy. Also, it's called "Deep C Secrets" and has a giant fish on the cover. What more do you need to know?

I skimmed "21st Century C" briefly a couple months back and didn't have strong feelings about it one way or the other.

silentbicycle··on Comparing the Cost of Different Multiple-return Techniques in C
Due to an inconveniently timed cold, it may still be another day or two. Soon.
silentbicycle··on Comparing the Cost of Different Multiple-return Techniques in C
I'm not sure, and digging into it would likely be a separate post. It's probably due to OpenBSD having very different cache strategies from OSX or Linux. It seemed to consistently do badly on the first run or two, then catch up on on the rest. It's often recommended to throw away the first run in a set of benchmarks, due to the added overhead of disk IO, but I wanted to retain that because something interesting is going on there.

The graphs also show more overhead for returning a struct with additional padding. OpenBSD's memory allocator favors security rather than speed, and the extra size may have costs for buffer overruns felt elsewhere. I like testing C code on OpenBSD -- it's almost as good as valgrind for detecting memory bugs, but with significantly less overhead, since the memory checking is integrated into the OS.

silentbicycle··on Comparing the Cost of Different Multiple-return Techniques in C
I'm planning on posting a repo with the benchmarks soon.
silentbicycle··on How can C Programs be so Reliable? (2008)
Embedded test software is developing. Look at http://throwtheswitch.org/ and my (more minimal) "greatest": http://github.com/silentbicycle/greatest
silentbicycle··on On programming without malloc
There are editions of the book using ML and Java. Since Andrew Appel is involved with SML/NJ, the ML edition is most likely the original. (The ML one is also quite good.)
silentbicycle··on Natural born programmers
The effect is not specific to women. The paper he linked is, but it also has a bibliography.

I'm not wasting any more time debating this with you. Cheers.

silentbicycle··on Natural born programmers
Sure. The error in your reasoning is that you greatly mischaracterize his point, which is that the concept of the natural-born "10x programmer" is quite destructive.
silentbicycle··on Natural born programmers
Before writing the post off with a logical fallacy, perhaps you should consider the biases inherent in doing so, and whether they are distorting your reasoning: http://plover.net/~bonds/bdksucks.html
silentbicycle··on Luje 0.1 – a pure Lua JVM
Did anybody take notes from the Mike Pall's LuaJIT talk? I've been asking around on Twitter, but no luck so far. (My contact info is in my profile.)
silentbicycle··on Smalltalk: Swimming with the fish
At the same time, so much recent tool development has focused on virtualization. Vagrant, chef, puppet, packer, ... and yet, Smalltalk has decades of experience with whole virtualized machines to we can study.

Perhaps systems like Smalltalk still have something to teach us?

silentbicycle··on Strangeloop 2013 slides
I think it may be a few weeks before the video timeline is posted, but conference attendees are able to access draft videos of nearly all the talks already.

It was quite a conference, and several of the talks were really good. I too wish they posted the talks publicly sooner, but posting them through the year seems to be a very effective way to sustain buzz.

silentbicycle··on Ruby 2.1 Garbage Collection to Address Criticism on Large Scale Deployments
Garbage collection is a particularly cross-cutting implementation issue, and tends to interfere with all kinds of abstraction. You're essentially making a system that knows which specific ways abstraction can be broken safely, so that you can defer resource management to it in the future. Retrofitting a GC is even harder. You can bolt on a conservative collector (like boehm-gc), sure, but that can lead to many unexpected performance issues (see e.g. http://timetobleed.com/6-line-eventmachine-bugfix-2x-faster-...).

Writing a virtual machine for a GC'd language and then trying to give it a portable, reasonably convenient C API convinced me that it's a significantly harder issue than most people realize. (Particularly after scrapping my third prototype!) The C API also impacts many things, and tends to bring up nasty edge cases in the GC.

Lua seems to have settled on a design that works unusually well, and is worth studying. Still, Lua can safely cut corners that Python and Ruby cannot - they have threads, which also break a lot of assumptions.

silentbicycle··on Compiling to Lua
Lua has access to the filesystem, but you probably want the luafilesystem module for general scripting, it provides more POSIX and Windows-specific functionality.

As a general rule, the Lua standard library only includes what can be portably built on the C standard library. Instead of "batteries included", Lua is small and portable everywhere ("travel light"), and makes it easy to wrap other functionality via the C API. Sometimes that's a problem, but sometimes it's exactly what you want - say, when Python would be too big a dependency, Lua is an excellent option.

(No experience with MoonScript. I'm content with Lua's syntax. I much prefer it to Ruby's, for example.)

silentbicycle··on Ruins of forgotten empires: APL languages
As Scott Locklin said in a parallel comment, J already comes with excellent documentation and tutorials. This would be a better starting place: http://www.jsoftware.com/jwiki/FrontPage

As a language, J isn't ever going to fit comfortably into a "Learn X in Y" format -- there are too many unfamiliar ideas, it isn't just syntax.

silentbicycle··on Ruins of forgotten empires: APL languages
You'd be surprised. I'm more familiar with k (kona) than J, but many of those seemingly inscrutable blocks of punctuation become recognizable as a unit pretty quickly. You can, of course, break huge expressions like that apart and name the chunks.

kona: https://github.com/kevinlawler/kona A free implementation of a k3.2-like language.

There are equally strange patterns that you are probably used to. For example, I see stuff like

    PORTB &=~(1<<3);
when doing embedded development. That's C, and unlike in J, in C I have to also keep track of order of operations.
silentbicycle··on A Field Guide to Lua Coroutines
I saw a patch he wrote for copying coroutines, for those who miss multi-shot continuations.
silentbicycle··on Lua 5.3.0 (work1) now available
Lua has always supported integers, as a compile time setting. Instead of having a full numeric tower, it has a LUA_NUMBER type that can be changed (doubles, by default), and also makes adding new numeric types at runtime (such as libGMP bignums) easy via metatables and dynamic linking.

While this may seem strange, keep in mind that Lua is designed for scripting code in another language. It tries to assume as little as possible.

silentbicycle··on A Field Guide to Lua Coroutines
Thanks. :) I'm still mostly using Lua 5.1.4 most of the time, and I forgot to include that.
silentbicycle··on Learn Lua in 15 Minutes
I agree, they're tricky. I'm currently working on a blog post about them. :)
silentbicycle··on Learn Lua in 15 Minutes
This is a good start, but there's also some deeper ideas in Lua. It has a good implementation of coroutines, for example; if you're familiar with continuations from Scheme, they fit most of the same uses. (They're like generators from Python or fibers from Ruby, but with less edge cases.)

The C interop is also a Big Deal. Lua seems like a cute little language, like a cleaner Javascript, but it's a LOT more useful if you're also proficient in C. Also, Lua will run anywhere you have an ANSI C compiler and a modest amount of space.

silentbicycle··on Behind the Scenes with Chicken Scheme and Spock (Part 2)
Part 1 of the post (http://spin.atomicobject.com/2013/05/02/chicken-scheme-part-...) focused on CHICKEN, this one focuses on SPOCK, a Scheme that compiles to JavaScript.
silentbicycle··on ffind: a sane replacement for command line file search
I wrote a similar tool to this in C, ff (https://github.com/silentbicycle/ff).

The main difference is that, where `ffind foo` appears to be comparable to

    find . -name "*foo*"
, ff is closer to

    find . -name ".*f.*o.*o.*"
In other words, you don't need an exact match, just the characters given in order. (This is inspired by Lisp-y toolchains where e.g. c-w-c-c would search and expand to call-with-current-continuation.)

There are some other features (e.g. '=' toggles literal match, it has smart handling for '/' and directory name grouping), but it's pretty straightforward to use. It also doesn't depend on python.

silentbicycle··on Real-Time Garbage Collection Is Real
I've had and enjoyed both. The latter has less about the fundamentals, but adds chapters on real-time GCs, concurrent GCs, and other advanced material. (Most of whose research probably came out after the first edition.)

If you're interested in GCs, I would suggest getting the newer edition for advanced material, and deferring to freely available papers such as Wilson's "Uniprocessor Garbage Collection Techniques" for fundamentals.

silentbicycle··on Why a BSD License Might be Wrong for your Embedded Open-Source Project
My focus on licenses so far only really concerns making it easier for vendors like the OEM to use my library. When I open-source hardware layouts, I now know I need to investigate license details for hardware-specific language. (I don't have any control over the hardware in this case.) I don't mean to imply that I've fully solved the issue yet, just to draw attention to it being even more complicated than expected.

I've also noticed that, while the ISC doesn't specifically address binary distribution the way the BSD license does, the zlib license specifically notes that its copyright conditions apply to source distributions, so it seems like an even better choice in this specific case.

← PreviousPage 2 of 34Next →