|
Haskell is easily my favorite imperative language. There's just so many tools available to express your intentions and reason about your code, even without getting into the really clever abstractions. Also, lens is amazing.
|
# ¿ Feb 27, 2016 08:21 |
|
|
# ¿ May 15, 2024 05:56 |
|
Doc Hawkins posted:drat, what's your favorite functional language then? Mostly I'm trying to make a point about paradigm availability.
|
# ¿ Mar 1, 2016 02:07 |
|
My experience in Haskell, at least, has been that purity isn't so much about never having side effects but rather quantifying them as precisely as possible, e.g. with various monads. I don't know what the idiomatic approach to that is in Closure, but if your computational task really demands mutable state that certainly doesn't mean it's poorly suited to implementation in a pure functional language.
|
# ¿ Mar 5, 2016 01:16 |
|
The Haskell Platform is pretty much deprecated in favor of Stack, FYI. It keeps things isolated and is generally a huge boon to reliability. The GTK bindings are kind of broken on Windows, and I don't think Leksah (or EclipseFP for that matter) is really very well supported in general; most people just use one of the major editors like Emacs or Sublime or Atom.
|
# ¿ Mar 15, 2016 01:08 |
|
hannibal posted:EclipseFP is dead, the main guy stopped working on it. If Emacs is too much I'd go with Sublime, Atom or VSCode.
|
# ¿ Mar 15, 2016 18:32 |
|
You've got a lot of really good points here, but it isn't any kind of coincidence that Haskell is the place where transactional memory is becoming/has become conventional.
|
# ¿ Mar 26, 2016 01:57 |
|
Athas posted:No, but transactional memory is not automatically very performant (again: parallelism is easy, efficient parallelism is not). Furthermore, another reason is probably that GHC is the most dynamic and active research compiler I know of, and run quite well by people both technically and socially competent.
|
# ¿ Mar 26, 2016 19:17 |
|
rjmccall posted:As a former PhD student who once wrote an embarrassingly-gushing-in-hindsight essay about TM... kindof? It's very easy to write code that is obviously "correct" with TM, but that means a lot less than you might think. TM — hardware or software — tends to degrade terribly in the face of any actual contention for the memory being accessed, because of course the transaction cannot be applied if any of the memory has been touched. But even absent contention, verifying the validity of the transaction is very expensive in software implementations, and hardware implementations tend to both impose arbitrary implementation limits and add a risk of spurious rejection. This is all exacerbated by the fact that TM as expressed in systems like Haskell makes it very easy to construct enormous transactions which would require a minor miracle to actually apply in a system that isn't vastly over-specced for its load.
|
# ¿ Apr 2, 2016 09:20 |
|
Banned King Urgoon posted:It won't, because macros and functions serve different purposes (and you should never use a macro when a function will suffice). The reason for macros is to implement new syntactic forms, with their own flow control.
|
# ¿ May 19, 2016 21:03 |
|
Siguy posted:I was talking a little out of my rear end since I didn't put much effort into learning Common Lisp, but all the built-in functions felt very old-school and weird to me, with lots of abbreviations and terminology I wasn't familiar with. That doesn't mean they're bad necessarily and I probably overstated saying they have no logic, but as someone new to the language I didn't understand why sometimes a common function would be a clear written out word like "concatenate" and other times a function would just be "elt" or "rplaca".
|
# ¿ May 20, 2016 07:15 |
|
xtal posted:Lately I've been learning Idris because Haskell has a bunch of warts that make me cry. The library support is, expectedly, lacking, so I'm considering writing Haskell with an alternate prelude instead. Has anybody worked with ClassyPrelude, Protolude or Foundation who can help me decide what to use? (Or tell me if this is even a good idea, because I expect I am going to need to add a whole lot of string conversions for compatibility with libraries.) Idris is fun to play with, but it doesn't supplant Haskell, no matter how excited I might be about what dependent types will do for software development long-term.
|
# ¿ Sep 3, 2016 01:51 |
|
Asymmetrikon posted:I like Idris over Haskell because of some of the historical weirdness it got rid of (switching : and ::, returning Maybe instead of erroring in, i.e., List access functions, the whole Monad/Applicative thing, Int vs. Integer.) I haven't looked too much into GHC 8, though. xtal posted:I have a bunch of small complaints (Idris improves a lot more than the type system) but the lack of performance (String) and safety (totality) in the Prelude are what gets me. Having an opaque list type already pokes holes in type safety, so at the very least I want a Prelude that is total. Alternatives also tend to be implemented via type classes rather than concrete types which I prefer.
|
# ¿ Sep 4, 2016 18:19 |
|
xtal posted:I just wanted you to know I am really on board with lenses now. I was avoiding them because I think Template Haskell is the plague but I'm able to compartmentalize all of that junk in a Types file. You don't actually need to use Template Haskell to use lenses at all, even advanced things like biplate; the boilerplate is concise and linear wrt. your original code. The TH just saves a few lines and ensures consistency, which is enough reason for me to use it, but it's by no means unavoidable. One of the original design goals of lens was actually to allow people to easily make libraries compatible with it without even depending on the package.
|
# ¿ Sep 10, 2016 02:29 |
|
xtal posted:So your choices are the horror of template Haskell or the horrors of boilerplate?
|
# ¿ Sep 19, 2016 00:05 |
|
everythingWasBees posted:As I'm finding myself using C++ and C# for everything course and research related, I'd really like to try a functional language to give myself a breath of fresh air. I'm mainly interested in making games and interactive graphical toys. Is there a language with more robust Vulkan and OpenGL support than others? Is there any that are more suited than others for games? I know you can use F# with Unity, is that a decent choice?
|
# ¿ Oct 21, 2016 05:51 |
|
Nix is absolutely glorious, especially for software development, since it makes it very easy to maintain (and share!) a wide variety of different build environments with predictable versions of dependencies and tools available. Also for servers because it's a lot easier to fix/update a system that you haven't touched in two years if the entire system is described by a short stateless config file. The language isn't great, but it's good enough. I'll take some idiosyncratic syntax over stateful package management any day. xtal posted:It's decently efficient. Performance is, by their admittance, not a priority. You can generate more than just C, though. JavaScript, CLR, JVM and LLVM backends are under development by third-parties. That said, dependent types are absolutely glorious and everyone should be very excited about them becoming more accessible. I'm optimistic that Haskell will eventually provide them in a non-awkward way (it's been going that direction for a while), but what I really dream of is Rust someday getting there. Writing arithmetic proofs can be annoying, but real-world code is full of issues arising from people getting simple arithmetic wrong, so it doesn't really seem gratuitous.
|
# ¿ Dec 1, 2016 19:44 |
|
Shinku ABOOKEN posted:Genuine question: What's the real world utility of dependent types? e: Whoops, this has already been answered thoroughly. Oh well.
|
# ¿ Dec 2, 2016 04:44 |
|
Alternatively, Software Foundations is available for free in its entirety. It teaches dependent types using Coq, which has many of the fancy features Idris dreams of, up to and including a smart editor tightly integrated with the compiler. This is the language that CompCert, the proven-correct C compiler, is written in.xtal posted:Dependent types are p much the best CS invention in my short lifetime. They can theoretically eliminate runtime errors. Making your program total and terminating is sometimes an additional benefit. Ralith fucked around with this message at 06:22 on Dec 2, 2016 |
# ¿ Dec 2, 2016 06:20 |
|
xtal posted:Does anyone know if Typed Racket or Clojure has support for quasi-dependent types? Gradual types seem like a nice compromise to me since you don't need to type absolutely everything, and you can still statically verify them. rjmccall posted:I did research on a "practical" dependently-typed language for a year in grad school, and yeah, this was my experience: you spend a lot of time proving basically trivial things. And that was for well-known problems like discussing the length of a list; my experience with trying to prove novel things about real programs (this time in Coq) was that even formulating the types in a way that allowed a proof to proceed was just an unending series of major research problems, which is not a surprise to anybody who's ever done real mathematics, but which constantly seems to surprise the CS folks.
|
# ¿ Dec 18, 2016 23:31 |
|
Gnumonic posted:The anonymous function and squish2 each return a list, not the first item of a sub-list, and I can't understand why the "correct" version of squish doesn't do the same. (i.e. I can't figure out why the output isn't [[1,2,3],whatever] rather than [1,2,3,4,5]). Am I missing something really obvious?
|
# ¿ Jan 2, 2017 07:09 |
|
xtal posted:What is the best language to use on a Raspberry Pi? Haskell runs fine but lens has been compiling for over a day
|
# ¿ Jan 8, 2017 22:06 |
|
xtal posted:Self-quoting for context. How much of a coding horror would it be for me to make a Lisp syntax for Rust using Haskell and parsec? One of the fun things about the Rust compiler is that it's pretty well factored into a bunch of distinct libraries--you might actually be able to just drop in a new front-end rather than doing syntax-to-syntax transforms. You'd need to write a parser in Rust to do that, but s-expressions are pretty easy and nom may not be parsec but people seem to like it. This will probably be even less stable than something that emits rust syntax, since internal compiler APIs change whenever they like, but would IMO be a way more interesting project. Asymmetrikon posted:Well, I'm doing this for C (with intent to create a lot of macros to automatically do generics/monomorphisation/better types/etc.,) so I'd be a hypocrite if I didn't say go for it
|
# ¿ Jan 18, 2017 18:39 |
|
My two most recent Haskell projects were a geospatial webapp for a hackathon at work, and little GUI utility to implement the Schulze voting method (lesson learned: never, ever try to write a portable GUI by using GTK in any language).
|
# ¿ Feb 2, 2017 01:32 |
|
Ploft-shell crab posted:I'm looking at Idris.
|
# ¿ Feb 4, 2017 20:59 |
|
|
# ¿ May 15, 2024 05:56 |
|
xtal posted:Any of you guys hosed with Idris? 1.0 just came out and I want to use it but there's still no package manager... xtal posted:Having Idris use a general package manager would be way better than building another package manager for every single language but Nix looks kind of hacky and cruddy tbh
|
# ¿ Apr 2, 2017 05:21 |