Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
junke
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
76 ms
·
691.
▲
by
junke
11y ago
> But consider that I think it obvious that (every)thing should cover all things, this would include instantiations of types as well as the types themselves. Types are there to describe the values that can be manipulated by your program
692.
▲
by
junke
11y ago
In that case the everything type is just bottom. (edit: to be clear, the bottom type, aka zero/empty type).
693.
▲
by
junke
11y ago
I think I can understand if Scala does not want to consider this kind of constant folding: after all, in most code you are supposed to have the same type on the "then" and "else" branch (in OCaml for example you don'
694.
▲
by
junke
11y ago
This is how the existing type checker works, from primitive types and combination rules. Some rules are more precise than others, though. I think in Scala the type system does not depend on the implementation, but it is specified by the lan
695.
▲
by
junke
11y ago
Well, sure, but the over-approximation is surprising given that false is constant and "if" is supposedly a well-known construct.
696.
▲
by
junke
11y ago
> if (false) 23 else null Why isn't the type of this expression Null?
697.
▲
by
junke
11y ago
The any type is an "or" of all your types. Any value in your type system belongs to the top type. The bottom type is a type for which no existing value belongs to this type. What would an "everything" type be? I'd g
698.
▲
by
junke
11y ago
You can certainly put the payload into multiple lists. From http://www.crashcourse.ca/introduction-linux-kernel-programm... : > More to the point, a payload is welcome to participate on several lists, but only after defin
699.
▲
by
junke
11y ago
Give Ada a try
700.
▲
by
junke
11y ago
The last time you discussed about this[0], you attributed to Common Lisp some problems that were present with Scheme's multiple values. And here, as explained in this thread, Wasm is not a user-facing language but the target of compile
701.
▲
by
junke
11y ago
From https://www.w3.org/community/webassembly : > The mission of this group is to promote early-stage cross-browser collaboration on a new, portable, size- and load-time-efficient format suitable for compilation to
702.
▲
by
junke
11y ago
This is not only about code size, but about efficiency and, more fundamentally, about what multiple values are. Are MRV just syntactic sugar around lists, a second-class mechanism ("tuples don't nest") for when you have zero
703.
▲
by
junke
11y ago
The discussion on github also mentions Lua ( https://github.com/WebAssembly/spec/pull/215#issuecomment-17... ), though it is true that this is coming from a Common Lisp developer. From my point of view the feat
704.
▲
by
junke
11y ago
If you use only structs, lists, numbers and strings, print is perfect. It supports circular structure when PRINT-CIRCLE is true. For custom classes you have to define custom printing methods, because, well, how you print a particular objec
705.
▲
by
junke
11y ago
I don't understand what is contradictory here. > The golden rule of programming has always been that clarity and correctness matter much more than the utmost speed. Very few people will argue with that. And yet do we really believe
706.
▲
by
junke
11y ago
You don't have to write it all over the codebase. If you have a specific need, defmacro yourself out of your problem. Generally speaking, taking a secondary value alone feels like a bad use of MVR (it happens rarely with standard funct
707.
▲
by
junke
11y ago
I have a hunch that you defined make-vars as a separate function just to be able to nest two multiple-value-bind, one in the macro and one in the expanded form ;-)
708.
▲
by
junke
11y ago
Agreed, structs and classes make often more sense to aggregate data, especially when they are all equally important.
709.
▲
by
junke
11y ago
I agree that Lisp is not always terse, which surprised me at first too. You can abstract many constructs and eradicate redundancy, but at some point, your only chance of being terser is to use reader macros. However, doing so might not be a
710.
▲
by
junke
11y ago
If you wrap your data in a list or a tuple, it is still a single value. It makes sense to talk about true MRV in languages that support it, like Ada, Forth and others... ( https://rosettacode.org/wiki/Return_multiple_val
711.
▲
by
junke
11y ago
Multiple values are not "just" an optimization hack, they are designed to be convenient to use. I don't know which construct you find "weird". Multiple-value-bind is a descriptive name which is long to type but thi
712.
▲
by
junke
11y ago
Ada has in, out and in/out parameters which adds a little more semantic to C and C++'s pointer parameters. Author mentions Common Lisp's multiple values, and one of the main feature of multiple values is that they are optiona
713.
▲
by
junke
11y ago
I remember issuing "call -151" on an Apple IIe to enter the monitor. I was too young to understand how it worked, but I was using the examples from the manual to define fast-drawing code for shapes (defined with an existing langua
714.
▲
by
junke
11y ago
I did not use them, but look at mocl[1] and Lispworks[2] for Mobile. [1] https://wukix.com/mocl [2] http://www.lispworks.com/products/lw4mr.html
715.
▲
by
junke
11y ago
The whole series of article from Junio C. Hamano, and in particular "Fun with merges and purposes of branches" ( http://gitster.livejournal.com/42247.html ) are full of good advices regarding how to use branches, me
716.
▲
by
junke
11y ago
The sqrt implementation is probably known to be side-effect free by the compiler.
717.
▲
by
junke
11y ago
> "Live programming" means that the code is being executed as you type it. Not only. The article references related work, but somehow it focuses on a single level of liveness[0], which is instantaneous feedback. It is great whe
718.
▲
by
junke
11y ago
The first book was great.
719.
▲
by
junke
11y ago
Thanks for this information. My point was more that map and reduce do not inherently require a recursive implementation and can be implemented directly as loops. I don't follow closely TypeScript: is tail-call merging done when compi
720.
▲
by
junke
11y ago
Why not? map, fold/reduce are not necessarily implemented as the textbook says.
More ›