Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ericbb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
61.
▲
by
ericbb
14y ago
You claim (as I understand): (Java + Clojure) > Go && (Java + Scala) > Go That stance seems to require a low weight on the cost of conceptual and tool-chain overhead. I haven't measured, but I'd guess that the langu
62.
▲
by
ericbb
14y ago
> Now, you might want to ... acquaint yourself with [dataflow variables and declarative concurrency] because [they are] the centre-piece of Go's language features. Not so. Go has native support for neither dataflow variables nor declara
63.
▲
by
ericbb
14y ago
Alexander Burger indents his PicoLisp code more along the lines you describe. Example: http://rosettacode.org/wiki/Execute_Brain****#PicoLisp
64.
▲
by
ericbb
14y ago
> You do. (Or in reality, the whole world since the point of Mega is to share files.) That implication makes no sense to me. Why would you ever share a private key? The trust question is more about public keys. Do you trust that the key
65.
▲
by
ericbb
14y ago
What's "code-as-procedure" supposed to be? Denotation? And how could "code-as-procedure" fail to be easy to express using "code-as-data"? Isn't it more essential that "code-as-data" should be easy to express in "code-as-text"? (As that's wh
66.
▲
by
ericbb
14y ago
I would argue that there is an obvious correct answer for array indexing and nil pointer dereference. Go could have been designed to work like the following: x, err := *p Where err is nil unless p is nil. And for array indexing:
67.
▲
by
ericbb
14y ago
On the topic of when to use error-returns vs. when to use panic: I struggled with this aspect of Go coding too and what I decided was that, in order to choose your approach to errors, you should think about how important it is that your fun
68.
▲
by
ericbb
14y ago
I've been thinking about block implementation off and on for a while (hobbyist language designer here) and I'd like to try implementing them so that they are never values in the language semantics. That way, a class of errors becomes imposs
69.
▲
by
ericbb
14y ago
See also: http://lwn.net/Articles/336255/ (A discussion of Linux data structures, including lists).
70.
▲
by
ericbb
14y ago
Maybe use \033[L (ANSI for insert-line). Edit: If I understand what you're doing, then maybe you can use this: tput ind; tput home; tput il1; echo -n "header"; tput el; tput cup $LINES 0 Use "man terminfo" to lookup things like "il
71.
▲
by
ericbb
14y ago
I just want to add a link for people interested in this discussion. (Dynamic Languages are Static Languages by Robert Harper): http://existentialtype.wordpress.com/2011/03/19/dynamic-lang... With HN discussion here: http://news.ycombinat
72.
▲
by
ericbb
14y ago
Excellent points. I'm doing a lot of code reading myself these days so it's nice to be reminded of some of the risks. :)
73.
▲
by
ericbb
14y ago
To attach behaviour to data in a functional language, you typically use first-class functions. Your draw function would look for a function in each drawable object and call it. To your second question: find some great open source projects a
74.
▲
by
ericbb
14y ago
data structure != type
75.
▲
by
ericbb
14y ago
It seems to me that there's a latent virtual machine in this design. You are breaking code into basic blocks and handling control state in a first class way, so there need to be abstractions for all that, and those abstractions define a vir
76.
▲
by
ericbb
14y ago
> More research is needed! Agreed. And I'm looking forward to more posts on Outlet! I have a project that's similar in that it's a Lisp dialect designed to match my own tastes and to eventually run on a variety of platforms. So far, I'v
77.
▲
by
ericbb
14y ago
> As described yes, but you can extract the duplicate bodies in a function. However, if we do that globally, we're back where we started, right? I mean, the allocation rate of continuation closures will be on the same level as standard
78.
▲
by
ericbb
14y ago
Personally, I like the VM technique over compilation to JS source. With a VM, you can track the continuation by simple stack operations rather than furiously allocating JS closures. Think about the effect in memory: when you do a return in
79.
▲
by
ericbb
14y ago
Won't that lead to a code-size explosion due to the duplication of continuation bodies?
80.
▲
by
ericbb
14y ago
Yes, I was thinking that too. I like simplicity and I like complexity. I was also reminded of an old a comment from Guy Steele: http://www.youtube.com/watch?v=4LG-RtcSYUQ&t=1h21m11s
81.
▲
by
ericbb
15y ago
That's interesting. Sorry for not getting it right away. It's making more sense on second reading. :) Now I'm curious how you'd encode subroutine calls. Your example was completely inlined but the call-sequence will be critical in determini
82.
▲
by
ericbb
15y ago
My first try would probably be to use SP for one stack and some other fixed register for the other stack. Also, traditional Forth interpreters don't use code like you showed. I think the main benefit of using Forth (unless you just happen t
83.
▲
by
ericbb
15y ago
Pico Lisp might be a good starting point. Its interpreter for x86-64 machines is written using a simplified custom assembler and already uses a reduced number of registers.
84.
▲
by
ericbb
15y ago
I don't know about "most people" but I think a machine like this DCPU-16 is better than learning Python or Ruby. Those languages are huge and full of complexity. With a 16-bit machine with a tiny instruction set, the student actually has a
85.
▲
by
ericbb
15y ago
Typical solution is to use an interpreter (turning data into code). How often is it necessary to run arbitrary machine code on demand?
86.
▲
by
ericbb
15y ago
There's also the Woz method of thinking about the problem so intently that you can simulate the whole system in your head without even looking at any code. Being unable to write your program bug-free would be like not being able to recogniz
87.
▲
by
ericbb
15y ago
I won't get into the interface-crossing issue except to say that exceptions to the convention do exist. For example: http://golang.org/pkg/regexp/#MustCompile
88.
▲
by
ericbb
15y ago
Go doesn't lack exceptions. It just uses some different names (throw -> panic, catch -> recover) and uses a different way to write the code that catches them. http://golang.org/doc/go_spec.html#Handling_panics Edit: Also, here's a
89.
▲
by
ericbb
15y ago
The error type is an interface. You can return values that contain contextual information as long as the error value you return has an Error() method returning a string. type ParseError struct { line int } func (e Par
90.
▲
by
ericbb
15y ago
Have a look at the "gob" package for serializer and deserializer support for Go types. As for the syntax-related points, Go offers quite a bit. There's the goyacc tool, the scanner package, the template package (think quasiquote), and a bun
More ›