Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kbp
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
kbp
2y ago
Er, actually x = 2 x = "foo" [y] = [3] [y] = ["bar"] Sorry, I didn't re-read the code before translating.
2.
▲
by
kbp
2y ago
I'm not sure what you find incomprehensible about the first example. The syntax is pretty standard. The only exotic thing is `$`, which is basically just like putting brackets around the rest of the line. Here's the first example
3.
▲
by
kbp
2y ago
It works the same way in Haskell, eg main = do let x = 2 let x = "foo" y <- pure 3 y <- pure "bar" putStrLn $ x ++ y which is really the same as main = let x = 2 in let x = &q
4.
▲
The Design and Implementation of the Self Compiler (1992) [pdf]
(cs.tufts.edu)
2 points
by
kbp
2y ago
|
0 comments
5.
▲
An Algebraic Language for the Manipulation of Symbolic Expressions (1958) [pdf]
(softwarepreservation.org)
3 points
by
kbp
3y ago
|
0 comments
6.
▲
by
kbp
3y ago
Surely not in Canada?
7.
▲
by
kbp
3y ago
I can hear them and tell that they're different accents, but I don't really distinguish them, I would call them both "British" and I wouldn't know which one's more posh.
8.
▲
by
kbp
4y ago
Usually that effort should go toward naming functions rather than their results, though, and if the functions have good names, the results don't need them. In this example, `other_function` could have been named `get_user_data`, `new_f
9.
▲
Unix system programming in OCaml (2014)
(ocaml.github.io)
7 points
by
kbp
4y ago
|
0 comments
10.
▲
by
kbp
6y ago
Works in Ruby: irb(main):001:1/ puts(%r irb(main):002:1* a+ irb(main):003:0> .match? %q aaa ) true
11.
▲
by
kbp
6y ago
You can also ssh in via Emacs with Tramp, and use your highly customised Emacs to edit remotely.
12.
▲
by
kbp
7y ago
Unsigned integers are still specified to wrap.
13.
▲
by
kbp
7y ago
> Clojure has cons, car, cdr which you can use in the classic Lisp sense. The only thing you CAN'T do is have a dotted pair or dotted list in the last cons cell. So, it doesn't have them in the classic Lisp sense. Conses are ju
14.
▲
by
kbp
7y ago
Yeah, it's definitely a taste thing, but as the first style isn't used in Lisp, comparing its readability doesn't really make sense. Indentation is important to reading Lisp. Indenting it in an odd way makes it harder to pars
15.
▲
by
kbp
7y ago
That isn't how that defun would normally be formatted, though. Lisp knows that the 'body' part starts with the 3rd argument (the same way Clojure knows it starts with the second), so it indents the lambda list farther right (
16.
▲
by
kbp
7y ago
Could you expand on how Forth differs from Lisp? I don't know Forth.
17.
▲
by
kbp
7y ago
SICP called it design by wishful thinking; I always liked that.
18.
▲
by
kbp
7y ago
You're mixing your "playing by JS' rules" point with just general Elm features. Faster compilation speed, faster executables, and smaller executables are not JS' rules, they're just generally desirable things t
19.
▲
by
kbp
7y ago
> If you have a recursive data structure, using tail recursion over that structure is significantly more straightforward than writing iteratively. I actually wrote a comment about this recently: [0]. > [0] https://news.ycom
20.
▲
by
kbp
7y ago
I believe they're still object pointers in CPython, they're just ordinary singletons; in other implementations, they aren't even singletons. Python's object model doesn't have primitives. Adding special rules around
21.
▲
Unix system programming in OCaml (2014)
(ocaml.github.io)
4 points
by
kbp
7y ago
|
0 comments
22.
▲
by
kbp
7y ago
I don't think that's a great example for Python; that's just knowing what "is" is for. The fact that it works the same as == for small integers in CPython is an optimisation showing through, but only in a place wher
23.
▲
by
kbp
7y ago
Right, they describe different aspects of how types work in a language.
24.
▲
by
kbp
7y ago
Static typing is not a superset of strong typing, they're on different axes. Strong vs weak typing (which I explained in the second paragraph) is about how strictly types need to match expected types before you get a type error. Static
25.
▲
by
kbp
7y ago
When people say that, they mostly just mean that it has lexical closures, I think.
26.
▲
by
kbp
7y ago
Why aren't statically typed programs really just dynamically typed programs where all the types happen to be statically inferable?
27.
▲
by
kbp
7y ago
Static typing means that types are figured out statically by looking at the source code, and type errors are detected then when it notices a mismatch. Dynamic typing means that types are worked out at runtime by looking at live objects when
28.
▲
by
kbp
7y ago
Not automatically coercing values is all that strong typing means. Getting a type error before you run the program is static typing. They're separate axes, and both useful to talk about in a language.
29.
▲
by
kbp
7y ago
A method named "method!" means that it's a somehow "unsafe" version of the method "method". A lot of the time it means "destructive version," but if there's no non-destructive version, the d
30.
▲
by
kbp
7y ago
Threads are C11, not C99.
More ›