4 ms·
Off the top of my head, any of these would have been a much more sane choice: Standard ML, Ada, Java, concatenative languages, E, Lisp, Haskell, Erlang, Python.
by lhgaghl 13y ago
Off the top of my head, any of these would have been a much more sane choice: Standard ML, Ada, Java, concatenative languages, E, Lisp, Haskell, Erlang, Python.
> few people (including me) would accept a "security upgrade" which made my browser significantly slower and memory hungry.
I can't tell if this is a joke. You know practically website is constantly running the shittiest JS you can imagine (and sometimes Actionscript), right?
Even if the language somehow can't handle implementing a certain task efficiently, you could still make a separate OS process for say, decoding the video stream, and passing it back to the safe code.
If you think there is a technical reason that browsers/OS today are written in C/C++ you are wrong. The reasons are purely circumstantial. Also note that most C/C++ coders aren't aware that other languages even exist or are practical, so good luck getting them to switch.
- krick 13y agoGod, I hate that "link expired" stuff. I wrote you a pretty long response and failed to save it in exchange buffer. It was covering every language you mentioned (except Java, which also is pretty horrible), but as I'm not willing to reproduce it, so let's concentrate on what bothers me: Haskell. So, the essential. If Haskell is "better" than someting else, then, by definition, it's easier to write good software in it. I wrote about my personal experience in the lost reply, but it doesn't really matter. The question is, why people who believe that Haskell is better for writing browsers won't prove it themself? By doing, I mean. I haven't seen a popular (lets take it as quality measure) browser, P2P client, feature-full messaging client/service or image editing app written in Haskell. Only pandoc, Xmonad, Yi and countless links to haskell.org success-story page, which isn't working app. Actually, it's true for any language, but nothing is mentioned as often as Haskell.
- lhgaghl 13y ago> God, I hate that "link expired" stuff. Heh, I use tor, and it just took me over 10 tries to login to reply to you (changing exit nodes to find one that isn't blocked, etc). If you don't like Haskell for some reason, replace it with something else. Heck, a browser in pure JS would be preferable to a browser in C (note: it doesn't count if you have 50 libraries implementing audio/visual/crypto/compression written in C and linked into the same address space as the JS). But it takes huge capital to implement a browser, and you'll still have the other issues like CSRF, clickjacking, phishing (each of which have been solved ages ago by waterken btw: http://waterken.sourceforge.net/web-key/ http://waterken.sourceforge.net/web-key/), X.509 (which has been solved by tor hidden addresses and other systems like it), and other mystical issues that arise because of how incoherently-designed the web is. Anyways, why do you think C would be any better for implementing a browser than any of these languages?
- krick 13y agoNo, I don't "don't like Haskell" for any reason, I just see many people talking about how cool and productive it is, so I want them to stop talking and show it in practice. Because, as I said, there aren't many (should I say "any"?) successful apps written in it, so it's a little hard for unenlightened people like me to grasp how good it is. Yes, I know that writing a browser or anything serious is a lot of work. But it's productive, right? And quite many people do that in their free time… well, maybe not a browser (at least I haven't heard about that), but at least bittorrent clients, p2p network layers, feature-full messaging clients, firewalls, anything. Their authors started them alone in their spare time, for free. And they are written in C, C++, Python, sometimes Java. Why? Obviously, because their authors for some reason chose that language. They decided it's better. And nothing is written in Haskell. It was like that 5 years ago, Haskell evolved, became much more popular (actually I even do know a company that uses it in production, but it's not the point) and that statement is still true. So every time somebody starts bragging about how all-powerfull Haskell is and how stupid are people that actually write something to choose C++ instead, I can help but ask: so why won't you prove on practice that Haskell is better? Because, once again, for PL "to be better" is to make its user more productive and more able to write quality software. So, it seems to me that this "why won't you…" argument (which is pretty ugly in many cases) is fair enough in this case. Now, I don't want to rewrite what I said about languages you mentioned, because it was pretty long. So, in short. ML — dead. Python — way too slow (if "browser" is everything including engine, not some shell around webkit). Erlang — just isn't built for that purpose (it's dynamic, highly concurrent "built to fail" language — are you even serious?!). Java — well, maybe, but it's not the perfection itself.
- lhgaghl 13y ago> No, I don't "don't like Haskell" for any reason, I just see many people talking about how cool and productive it is, so I want them to stop talking and show it in practice. Because, as I said, there aren't many (should I say "any"?) successful apps written in it, so it's a little hard for unenlightened people like me to grasp how good it is. I can't even be bothered to look at what who is using what language for, so I'm not going to debate this... I use Haskell every day, as well as a bunch of other languages, some of which nobody heard of, and they all work fine. > so why won't you prove on practice that Haskell is better? Because I don't care? > Because, once again, for PL "to be better" is to make its user more productive and more able to write quality software. Which you can easily do in Standard ML with no surprises, because it's a straightforward simplistic language and it's been like that since the 70's. But you dismiss it because it's not popular or something (despite being used by hundreds of thousands of people). > Python — way too slow Do you have any results to show this? I already pointed out, even if the language is too slow, you can just run C or assembly or whatever in a separate address space for each CPU intensive process. Your claim implies that the latency of passing the output of the worker in C/assembly back to Python (and passing new input from Python to the worker) would be too high. > Java — well, maybe, but it's not the perfection itself. So... you agree?
- MrBuddyCasino 13y agoThats actually a good point, I agree the list of "successful" programs for Haskell is a sad joke. I know some People in finance use it for HFT, but other than that? Can anyone give better examples? Because it is hyped a lot around HN, and I wonder if it is worth it to learn.
- krick 13y agoYeah, everybody heard that about HFT. As I said, there people like pointing to that list: http://www.haskell.org/haskellwiki/Haskell_in_industry http://www.haskell.org/haskellwiki/Haskell_in_industry Many cool names (Facebook, Google, AT&T), but no real products. > I wonder if it is worth it to learn Well, you may try anyway. It's pretty interesting experience. Many people claim that after you are "enlightened" you'll hate other languages. Seems that I'm still not enlightened. It's nice to write parsers and similar stuff in it, but I couldn't find an area where it would be clearly better to use Haskell than some alternative I'd normally choose. If you don't need hight performance and your product is, say website, than some Python/Ruby seems more convenient (mostly because of many good libraries and instruments for them). Writing GUI app? GUI bindings for Haskell are pretty awful and unnatural. Real time? Sorry, optimizing Haskell is so unintuitive that I can't consider it. Plus it has big runtime and is lazy. Something hightly concurrent? Not better than Erlang. So, I came up with that it only suites well for writing Haskell compiler and there already is a couple of them.
- MrBuddyCasino 13y agoThats what I was afraid of. I'm still curious because learning Haskell would probably make me a better programmer, but I find it easier to motivate myself if its not just a theoretical exercise. Did you venture into web dev a bit? I find the 'once it compiles it usually is correct' bit tempting, as I have a hunch that this might be more efficient that writing tons of unit tests in a language like Ruby.
- lhgaghl 13y ago> Writing GUI app? GUI bindings for Haskell are pretty awful and unnatural. I've never had a problem with GUI coding in Haskell... Here's a few lines of some WX code I wrote: p <- panel f [] startButton <- button p [text := "start"] stopButton <- button p [text := "stop"] set p [layout := row 5 [widget startButton, widget stopButton] Seems pretty much like every other GUI stuff I used... > Real time? what. > Sorry, optimizing Haskell is so unintuitive that I can't consider it. I agree that space leaks are hard to fix / prevent, but meh, other mainstream languages have other problems that sum up to the same amount of pain. > Plus it has big runtime and is lazy. Big runtime? I'm not sure what you mean by this... In contrast, my web browser usually occupies a few hundred megabytes for trivial tasks. > Something hightly concurrent? Not better than Erlang. I'm not sure about that. Erlang has some very weird stuff going on (http://stackoverflow.com/search?q=user%3A2213023+[erlang] http://stackoverflow.com/search?q=user%3A2213023+[erlang]), and in Haskell you can program actor style pretty easily with channels/pattern matching, and then there's CSP, STM, Data Parallel Haskell, etc.