I tried out the english->hungarian and it's pretty hilarious, because hungarian version sound so german that even I can't understand what it says without the text. :D
I agree that Ocaml is just extremely well suited for making new programig languages. If you are interested in Ocaml+programming languages check out the plzoo: http://plzoo.andrej.com/
I personally think that Ocaml is really good at this, because I started converting the Scheme examples from the PLAI book to Ocaml and it's just felt right(maybe because I'm not fan of the scheme syntax).
It depends on the terms we set for our tests. Usually we infer things to be correct that are out of scope. For instance, my tests usually don't cover to test the runtime or hardware before executing tests. And what if laws of physics change? No seriously, I know what you mean. But I mean correctness in the bounds we set. Those bounds are different if you write software for aviation or biometric devices or an Instagram clone.
A developer that uses a narrower integer data type, or who wants to be clear that the argument is a member of an enumerated set of options, not an integer. What kind of developer represents non-integer data as an integer data type?
> I think random testing is a good way to get almost exhaustively tests.
I think that testing known/predictable edge and corner cases makes more sense (in some cases), but I also think that I was responding to a comment about the impossibility of using tests to prove correctness of a function, not about how to derive practical benefits despite theoretical limitations.
You are right, I didn't think the example through.
You are right, you can use tests to prove a function if
- the function has very limited arguments and
- the function is pure or does very limited amount of state change(side effect)
Generally speaking tests are not the right tool for proving program correctness.
1. Isolates can only communicate with each other using asynchronous method calls. So even though you can move some work to another isolate, you can't block waiting for it to complete, so your function still has to be red.
2. Isolates are very limited in what you can send between them, which makes then not very useful in practice for much of anything.
Agreed. When the manual says you can pattern match with term rewriting macros, I think of Erlang pattern matching. Would something like this be possible?
template mysum{a = @[]}(a: seq[int]): int = 0
template mysum{a}(a: seq[int]): int =
while a.low <= a.high:
a[a.low] + mysum(a[a.low + 1 .. a.high])
var x: seq[int] = @[1, 2, 3]
echo mysum(x)
Term rewriting templates are only supposed to be optimizations, not change the semantics. They happen on the AST, so the pattern matches are on the AST as well. You won't get the actual values of any variables, they aren't even known at compile-time anyway.
Actually Eloquent Javascript and sometimes Programming -- Principles and Practice Using C++.
I found the C++ book a little bit boring and maybe i wont read it trough.