Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
willtim
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
65 ms
·
661.
▲
by
willtim
9y ago
GHC Haskell is an advanced optimising compiler, which can get very near the speed of C and C++. However, to write fast programs, one must use the right data structures and algorithms. Often this means array-based strings and streaming IO, u
662.
▲
by
willtim
9y ago
Surely a more intuitive syntax would be: X ++ {'fo'+'o': 'bar'} ++ y Where '++' here means dictionary union, the choice of symbol is not relevant.
663.
▲
by
willtim
9y ago
Programming languages do influence how a problem is solved and this often affects architecture. This is especially true with respect to concurrency. However my main problem with C++ is security, not want architectures it inspires.
664.
▲
by
willtim
9y ago
> You can not stop the users from shooting themselves in the foot, but that is not the goal here. It should be the goal. Even experts make mistakes. This is why static type systems exist. The logical thing to do is to strengthen the type
665.
▲
by
willtim
9y ago
You cannot make C++ secure and safe with a library.
666.
▲
by
willtim
9y ago
Best practice has changed, but C++ does not enforce it. Did Samsung follow best practices with Tizen? Languages like Rust and Haskell are an attempt to put such best practice into the language tooling.
667.
▲
by
willtim
9y ago
I have programmed C and C++ professionally on and off for over two decades, but I don't think that is relevant here. C++ shares many of the same security and safety problems as C, that is why they are often lumped together.
668.
▲
by
willtim
9y ago
Assuming your analogy has merit, I doubt very much this is true. Computer modelling, for example, has improved significantly over the years. However, it is true that many high profile failures in aerospace have been due to software errors,
669.
▲
by
willtim
9y ago
It's not news to anyone that C/C++ puts the burden of security and safety onto the programmer. And it's getting harder all the time, see for example Spectre mitigation. C was designed alongside Unix in the 70's, a very d
670.
▲
by
willtim
9y ago
It's all written in C++, so from a security and reliability perspective, I'm sketical it's going to offer much improvement over Linux. I don't see any evidence yet of "new technology". I'm happy to be prov
671.
▲
by
willtim
9y ago
A rope data structure is very almost persistent. So perhaps I am splitting hairs! It could of course be made fully persistent if mutating operations are avoided. This would allow sharing them between threads.
672.
▲
by
willtim
9y ago
A more interesting approach would be to use persistent data structures. While possibly slower for some operations, undo is more efficient and there are really interesting opportunities for concurrency. See: https://github.com
673.
▲
by
willtim
9y ago
Types in any modern statically-typed language should go well beyond simple "machine types" and also capture semantics. If one is representing everything with Strings and Doubles, then the type system is not being fully exploited.
674.
▲
by
willtim
9y ago
I am regularly surprised by the contrary. Our lifts at work once displayed a popup from the "Desktop cleanup wizard".
675.
▲
by
willtim
9y ago
I use Haskell professionally in the area of quantitative finance in a large team with a multi-million line codebase. Everything is built upon domain specific libraries, sometimes many layers deep. And these libraries are constantly changing
676.
▲
by
willtim
9y ago
There's "Real World OCaml" (new) and "Real World Haskell" (a bit out of date). But my favourite introductory text, which is not free, is Graham Hutton's "Programming in Haskell".
677.
▲
by
willtim
9y ago
C# does not in any way represent the best that static typing has to offer. Try F#, Haskell or OCaml seriously before discounting static typing. These functional languages offer much better safety (e.g. no nulls, no casts, case exhaustivenes
678.
▲
by
willtim
9y ago
> People don't use parser generator tools because you wind up doing more work than needed to integrate it with the rest of your compiler. I don't think you can make such a sweeping generalisation. Both JavaCC and Antlr have sav
679.
▲
by
willtim
9y ago
GHC Haskell does nearly all its optimisation using trees and a high-level functional IR, so I think you are understating trees.
680.
▲
by
willtim
9y ago
Modern compilers seem to work with trees more often than graphs. Trees would certainly be easier to work with in any language. That said, functional languages can and do work with graphs when needed, but yes it is much more awkward than tre
681.
▲
by
willtim
9y ago
I think I'd have been confused as to why using a parser generator was also not similarly regarded as being too easy :) Interestingly, most mature industrial languages (e.g. Java, GCC, clang) use hand-coded recursive descent parsers. An
682.
▲
by
willtim
9y ago
I think compiler implementation is a particular sweetspot for functional languages. Here's a similar tiny example in Haskell: http://www.timphilipwilliams.com/posts/2014-05-22-the-essenc...
683.
▲
by
willtim
9y ago
Agreed. The Haskell version has advanced topics such as Free Monads in chapter 8 and higher-order functions in chapter 35! The author for each piece of content has also not been included, which means I have no way of knowing if the content
684.
▲
by
willtim
9y ago
This is a neat solution, but why is OVMF required (according to the guide)?
685.
▲
by
willtim
9y ago
This problem is made worse by technologies like JavaScript, which resemble system programming languages in the lack of restrictions placed on untrusted code. JS code can create threads, sockets, timers, perform I/O, loop or allocate fo
686.
▲
by
willtim
9y ago
In modern Haskell, we are more likely to use the Applicative instance for Maybe, e.g. fromMaybe 0 $ (+) <$> xm <*> ym
687.
▲
by
willtim
9y ago
My X1 Carbon came with a 3 year on-site repair warranty as standard, included in the price (contrast this with AppleCare which is very expensive). Did you buy yours from Lenovo?
688.
▲
by
willtim
9y ago
I'm not a Gnome 3 user or affiliated with Gnome. Personally I find it rather too bloated and sometimes buggy. I use i3, polybar and Rofi for my desktop. I think you are reading rather too much into my words, my point was only that, i
689.
▲
by
willtim
9y ago
Yes I remember the CDE desktop had virtual desktops, but they go back even to Xerox Parc (according to Wikipedia). There are many minor aspects that have been tweaked and are perhaps newer ideas though. For example, on my desktop, I can sea
690.
▲
by
willtim
9y ago
I haven't used one, but newer machines use Microsoft's "Precision Touchpad" standard which is supposed to close the gap and support fancy gestures. Personally I just use the ThinkPad nipple and as many shortcut keys as I
More ›