Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ufo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
27 ms
·
331.
▲
by
ufo
4y ago
Perhaps too close to justin.tv (aka Amazon®)
332.
▲
by
ufo
4y ago
If a function calls itself using tail-recursion, a compiler can turn that into a loop without too much trouble. However, if it's tail-calling a different function then that becomes more difficult; it would have to merge the two functio
333.
▲
by
ufo
4y ago
It helps optimization. One example is if you have code like this: if(condition) { error_stuff() abort(); } normal_stuff(); If the compiler doesn't know that abort exits the program, they have to compile t
334.
▲
by
ufo
4y ago
If arrays were first-class values we would be able to construct circular references: a[1] = a Even if we only allowed it on return values: function f(x) { return x } a[1] = f(a)
335.
▲
by
ufo
4y ago
I find that I tend to use AWK for text munging tasks that are too small to call a "project".
336.
▲
by
ufo
4y ago
In what situations do you miss goto the most, when implementing a VM?
337.
▲
by
ufo
4y ago
Could be worth a try. I didn't find the first half as boring as you did, but I did find the second part more fun.
338.
▲
by
ufo
4y ago
He's being modest :) Sure, the book doesn't cover many traditional compiler topics such as register allocation and code optimization. However, it does cover parsing and translating to intermediate representation, which is 90% of
339.
▲
by
ufo
4y ago
On Fedora, I think it might even come installed by default (possibly as a dependency of Python's Tkinter module). There's also Jim Tcl, an embeddable implementation with very few dependencies.
340.
▲
by
ufo
4y ago
Check out Tcl! It's built around strings, with a command syntax similar to shell. The standard library "exec" command allows launching programs including pipes and redirects. Although it's a bit clunky (e.g. there's
341.
▲
by
ufo
4y ago
Circular references is a big one. There are also performance advantages though. Reference counting turns operations that would normally be just a memory read into a read+write, because of the need to update reference counts. You also need m
342.
▲
by
ufo
4y ago
Does any one know what are the advantages of STR."templ" syntax vs STR("templ")?
343.
▲
by
ufo
4y ago
On the other hand, their energy is also more expensive...
344.
▲
by
ufo
4y ago
What is SSI?
345.
▲
by
ufo
4y ago
I always encourage people to go read Dijkstra's GOTO paper, instead of just its title. It's a short and easy read, almost like a blog post. If you pay attention, you can see that the he was talking about spaghetti code vs structur
346.
▲
Squeezing a Sokoban game into 10 lines of Haskell
(cole-k.com)
169 points
by
ufo
4y ago
|
31 comments
347.
▲
by
ufo
4y ago
Fun fact about %n: Mazda cars used to have a bug where they used printf(str) instead of printf("%s", str) and their media system would crash if you tried to play the "99% Invisible" podcast in them. All because the "
348.
▲
by
ufo
4y ago
What's the idiomatic way to move the self.x+=1 into a separate function? (From the "Function Abstraction" example)
349.
▲
by
ufo
4y ago
Are there examples of what the formatted code looks like?
350.
▲
by
ufo
4y ago
Tech demo for a robotics company.
351.
▲
by
ufo
4y ago
The Sudoku app I currently play is this one: https://f-droid.org/en/packages/org.secuso.privacyfriendlysu... (found by searching Sudoku on F-droid) My only beef with it is the difficulty. I feel that Hard is easil
352.
▲
by
ufo
4y ago
Technically, [0] is not allowed by the standard. The real issue is [] vs [1].
353.
▲
by
ufo
4y ago
Does anyone know what is the status of their refactoring effort to update all the flexible array declarations in the kernel? How far along are they?
354.
▲
by
ufo
4y ago
According to the article, it's better to use the new flexible array syntax (int arr[]) instead of the old zero-length syntax (int arr[0]), because that allows the compiler emit better warning messages.
355.
▲
by
ufo
4y ago
Ah see now. They're virtualizing the snes hardware, not cross-compiling.
356.
▲
by
ufo
4y ago
What do they do to ensure that the RAM layout is exactly the same as the SNES? For example, how do they ensure that the stack layout matches the SNES, the right mix of variables in registers vs in memory, and so on?
357.
▲
by
ufo
4y ago
Wow
358.
▲
by
ufo
4y ago
I was hoping for some clever abuse of AWK's patterns & regexes but clean code will also do :)
359.
▲
by
ufo
4y ago
The price for this is that you have to refactor the grammar, replacing all uses of left recursion with right recursion (iteration).
360.
▲
by
ufo
4y ago
Their compiler doesn't support sizeof. Maybe it's like that to ease bootstrapping?
More ›