Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pka
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
25 ms
·
211.
▲
by
pka
10y ago
For all I know Agreed.
212.
▲
by
pka
10y ago
Look no further! Try Purescript. It's basically Haskell (albeit strictly evaluated) and has everything you listed, plus a record system I really wish Haskell would adopt. I'm currently using it in production with purescript-thermi
213.
▲
by
pka
10y ago
There [0]: the GCD m n d type proves that the greatest common divisor of m and n is d. [0] http://www.cse.chalmers.se/~nad/repos/lib/src/Data/Nat/GCD.a...
214.
▲
by
pka
10y ago
As I said above, you can verify/prove the invariants you capture in the types. I don't know what you mean by "correctness of loops", but if you capture whatever it means in a particular type, yes you can. If you really w
215.
▲
by
pka
10y ago
But if it compiles its status is not unknown. It means it is well typed, proving the absence of a whole lot of bugs. Generally, refactoring in dynamic languages without tests or something like Clojure's schema is madness. Usually not
216.
▲
by
pka
10y ago
But, as you surely know, types prove something about a piece of code. This means they can very well prove the absence of (certain) bugs. So generally, the more invariants you manage to capture in your types, the more categories of bugs you
217.
▲
by
pka
10y ago
Leaving Haskell's deferred type errors aside for a moment; after you are done with your partially working code, what then? Relying on (the surely preexisting) 100% test coverage?
218.
▲
by
pka
10y ago
Well, he said "strong" :) Probably meaning a ML-derived type system, not C's or Java's.
219.
▲
by
pka
10y ago
Purescript doesn't have a runtime, unlike Elm, so in that sense it may be a thinner layer. However, the language itself is more advanced than Elm, allowing for more powerful abstractions but also having the side effect (haha) of having
220.
▲
by
pka
10y ago
Finally! Been wishing for something like this for a while, good job!
221.
▲
by
pka
10y ago
Sure. In Haskell for example you can turn type errors into warnings with a compiler flag. If you then encounter a type error at runtime the program will crash, much like in a dynamic language. And if it turns out the change was a dead end,
222.
▲
by
pka
10y ago
This will sound counterintuitive to dynamic language people, but prototyping is actually much easier with types. I often find myself rewriting 50 to 75% of the codebase in the early stages of prototyping, and without types I'd be much
223.
▲
by
pka
10y ago
In the time it took you to write your content-free comment, you could've googled Elm and seen the error messages yourself.
224.
▲
by
pka
10y ago
Sure, sucks. But anyway, would you like to live in a place where the majority of people don't like you? It's going to be a fact with our without referendums or laws.
225.
▲
by
pka
10y ago
I'm also of the conviction that everybody should do whatever they want if they don't hurt/bother anybody else. However, a consequence of this is that people will have to waive certain freedoms if the majority is bothered by t
226.
▲
by
pka
10y ago
It's interesting to observe how almost all mainstream dynamic languages move from "who needs types? types are very very bad and just get in the way!" to some sort of gradual typing or runtime type validation. * Javascript has
227.
▲
by
pka
10y ago
You are wrong. You can very much catch "key errors" at compile time.
228.
▲
by
pka
10y ago
To explain in simpler terms, what you do is promote values to types first. I.e. when a user enters a string, you have to somehow prove , using formal logic, that n < l. After that, the proof is encoded in the types and you can use funct
229.
▲
by
pka
10y ago
And now have those 10k programmers work on a single project. I bet the 10000 Ruby guys are gonna create a big, unmaintainable, broken mess. Even Java's primitive type system would be a big help when it's about software development
230.
▲
by
pka
10y ago
If you are building a bridge or a skyscraper, yes, you absolutely do. If you are building a house for your dog, then no.
231.
▲
by
pka
10y ago
I remember reading an "interactive" book as a kid (a book with numbered short episodes, and at the end of each one you are presented with a couple of choices how the story would continue, it was awesome) where the good guy was sen
232.
▲
by
pka
10y ago
I gave you my mail in the other reply, HN is really annoying for longer discusssions.
233.
▲
by
pka
10y ago
Drop me a mail, p<dot>kamenarsky, gmail.com.
234.
▲
by
pka
10y ago
@sklogic (can't reply directly): I know how to use macros, I've used them and I have come to the conclusion that there are much better tools. Seeing you know what a logical phallacy is, here is one more for you: "if you don&#
235.
▲
by
pka
10y ago
Before we continue, post a link to a free monad DSL you have written; I do not intend to waste my time in a discussion with a zealot. (I can send you examples of macros I've had to write, if you desire.)
236.
▲
by
pka
10y ago
Free monads would like to have a word with you about simple, modular, debuggable, composable DSLs. On the other hand macros are anything but composable or modular. Debuggable for some far off definition of debuggable, maybe.
237.
▲
by
pka
10y ago
Yea, understanding macros and writing your own DSLs doesn't make you some sort of aryan ubermensch programming craftsman. Macros really aren't that hard to get, and mostly not necessary when you have more coherent constructs at yo
238.
▲
by
pka
10y ago
I have to disagree. f x . g reads just so much easier than (comp (partial f x) g)
239.
▲
by
pka
10y ago
Important, sure, for our deeper understanding of the universe. They wouldn't, however, have a detectable effect on the world around us.
240.
▲
by
pka
10y ago
No?
More ›