Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
c-cube
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
62 ms
·
301.
▲
by
c-cube
6y ago
As far as typed FP languages go: - Scala has the whole OOP stuff - F# as well - SML: you probably need to do it by hand, with a record of closures, or something like that. It's ugly but it works. - OCaml has objects (it's in the n
302.
▲
by
c-cube
6y ago
I'm not confusing them :-) I think _closed_ union types (the syntax `a | b | c`) are almost as good as sum types, since they bring exhaustiveness checking to the mix. They also act as documentation. Crystal is a good example of a langu
303.
▲
by
c-cube
6y ago
It's already in at least kotlin and typescript, not to mention the languages that simply don't have null.
304.
▲
by
c-cube
6y ago
People build less unions because these languages fail them. Just add sum types or something similar, it's a disgrace to not have them in 2021. Static typing goes wonderfully well with them, allowing for exhaustiveness checks and all th
305.
▲
by
c-cube
6y ago
It's only relatively recently that D open source compilers became available. And by that point it felt too much of an incremental improvement over C++ to seriously gain traction, imho. The design also feels dated in places compared to
306.
▲
by
c-cube
6y ago
That's plain wrong. If static analysis was as reliable as rust, why would all these C codebases still be full of buffer overflows and memory errors? The borrow checker is, in effect, a static analysis tool... that requires a lot of ann
307.
▲
by
c-cube
6y ago
That's orthogonal. Msgpack is basically json but easier to parse from C, and less inefficient on floats and integers.
308.
▲
by
c-cube
6y ago
But that's my point; how can you be sure the compiler will emit the right code instead of assuming that the addition does not overflow and then proceed on pruning the test, since overflow on signed integers is not defined?
309.
▲
by
c-cube
6y ago
Naively, I imagine it's hard to implement (efficient) overflow semantics for integers in C, without any UB. Rust provides operators for [wrapping overflow]( https://doc.rust-lang.org/nightly/std/primitive.isize
310.
▲
by
c-cube
6y ago
Coq can do everything Z3 does (with a few axioms mixed in)... except for the fast automation a SMT solver is all about :-). The decidable logic fragment Z3 was king on for more than a decade — uninterpreted functions, linear arithmetic, arr
311.
▲
by
c-cube
6y ago
Not all recursion is tail recursion. If you traverse trees you either deal with your bounded stack somehow (or ignore the problem) ; derecursify by hand, which is a nightmare ; or refactor to continuation passing style. There are options bu
312.
▲
by
c-cube
6y ago
This is making me reconsider a bit my stance on laziness. I'm usually in favor of eager, call by value, cause it's simpler to reason about in terms of complexity; but in OCaml I often have to be careful about deep recursions and i
313.
▲
by
c-cube
6y ago
That's a weird take from someone named MLthoughts :p But you seem to think everyone agrees that dynamic languages are more productive and that using (say) haskell is a trade-off for performance. For people used to (good) static type sy
314.
▲
Curry-Howard Is a Scam
(blag.cedeela.fr)
10 points
by
c-cube
6y ago
|
2 comments
315.
▲
by
c-cube
6y ago
> Please. Yes, NN are still in their infancy but they are clearly foundational to general intelligence. This calls for a big fat "citation needed". What we call neural networks have very little to do with actual neurons, so I f
316.
▲
by
c-cube
6y ago
I'm curious. Intuitively, a non-recursive coroutine would yield a state machine that only goes "forward". If you add tail recursion into the mix, you could have cycles in the state machines (going back to the begin state), co
317.
▲
by
c-cube
6y ago
> C/C++ isn't a programming language, rather the abreviation for C and C++. Maybe the abbreviation should be `C & C++` then :-). But I'm not sure if infix precedences allow it to work.
318.
▲
by
c-cube
6y ago
I think a difference is that Elixir is deliberately dynamically typed, so you don't expect type safety. You write the happy path and rely on "fail fast" and the actor hierarchies to write robust code. Besides, Elixir/Erl
319.
▲
by
c-cube
6y ago
It's a really cool feature of sqlite. I use it in a prover benchmark tool [1] where each run produces a new sqlite file that I can rsync elsewhere. The tool can then list these files and connect to multiple files to do joins across the
320.
▲
by
c-cube
6y ago
When I see that, I have no idea if it allocates a new array or if it's in place. Which one is it? At least with a delete function it's clear.
321.
▲
by
c-cube
6y ago
And remember to implement distributed 2 phase commit to guarantee consistency! So much simpler than using old crufty sql
322.
▲
by
c-cube
6y ago
For all we know, the NSA has a ton of secret miners it could switch on suddenly to launch a 51% attack. Prove me wrong . (ok this is the stuff of conspiracy theories but it's still a possibility, isn't it?)
323.
▲
by
c-cube
6y ago
Is Ada memory safe in the presence of malloc/free?
324.
▲
by
c-cube
6y ago
This page was discussed on HN previously: https://news.ycombinator.com/item?id=21871479 Simply put, it's hyperbolic. Having several implementations would be good for multiple reasons, but one of them would be to put a
325.
▲
by
c-cube
6y ago
There's checked C [1] as the most recent take on a safer C. [1] https://www.microsoft.com/en-us/research/project/checked-c/
326.
▲
by
c-cube
6y ago
In what ways is it more capable than Pascal? At first glance Pascal seemed to have more features (including discriminated unions)?
327.
▲
by
c-cube
6y ago
Nitpick : neither ocaml nor SML have significant whitespace.
328.
▲
by
c-cube
6y ago
Except : - python scoping is not really lexical (and it captures variables, not the values they contain) - python is statement based, so lambdas are less powerful than in scheme. So not really the same thing.
329.
▲
by
c-cube
6y ago
Not even 90% of programmers are Americans. Or men. The whole world is not just republican VS democrats....
330.
▲
by
c-cube
6y ago
It's considered bad practice, as far as I know. The executable should decide that, not library.
More ›