|
VikingofRock posted:I don't know enough about the other functional languages to write an introduction for them, but if anyone posts some information, resources, example code, etc for other languages I will add it to this OP. F# is a functional language descended from the SML/OCaml family and based on Microsoft's .NET platform. This allows easy interop with C# and other .NET applications & libraries, but can lead to some awkwardness as much of the .NET standard library wasn't designed with functional programming in mind. In addition to .NET interop, you get some really awesome languages features such as 1) type providers, which use data files, database connections, or even other programming languages to inform your type system and Visual Studio's autocomplete, 2) Units of Measure, which let you tag primitive types with additional type data to reflect their units and have the compiler do dimensional analysis at compile time, and 3) computation expressions which let you write code in a way similar to Haskell's do-notation, but with more flexibility (and in my opinion, a bit more readable). F# resources:
Some cool F# things:
|
# ¿ Apr 30, 2015 18:51 |
|
|
# ¿ Apr 29, 2024 08:24 |
|
duck monster posted:Might be worth throwing Racket under the lisps. Its a scheme dialect with a really cool learning UI and some great libs. This is true. It's also the best way to get an SICP-compatible scheme (via #lang planet neil/sicp) right now.
|
# ¿ May 1, 2015 06:22 |
|
fleshweasel posted:I spent a lot of time with How to Design Programs in supplement to my regular college programming classes and it was incredibly helpful. It's what I recommend to everyone starting. It really strips away the stuff beginners should not be worrying about and helps beginners build good habits. HtDP and SICP are often mentioned together but they're really quite different in terms of approach and scope. HtDP is, I would say, appropriate for someone learning programming for the first time - it uses Racket's ability to work with images easily to make it more engaging, it introduces file IO early to make it easier to solve practical problems, and it talks about topics like testing very early as well. SICP favors more difficult algorithmic challenges and is very theory-heavy - I'd recommend it for people who already have some experience with programming to help them go back and thoroughly understand the fundamental concepts of computer science. HtDP is a book about programming, which includes a bit of computer science, while SICP is a book about computer science, which includes a little bit of programming. They're both excellent books targeting slightly different audiences.
|
# ¿ May 1, 2015 17:59 |
|
Lumpy posted:As someone just starting to look into functional programing, which ones are the "impure" ones? Why are they only "functional-ish"? Why should I avoid them? "Pure" functional languages are those which force side effects (mostly you can think of this as any sort of input or output, although it's broader than that) to be reflected by the type system. Haskell is the only language that's even kinda-sorta mainstream that's purely functional, with some experimental languages like Elm, Agda, and Idris also falling in that category. A language being purely functional brings a lot of tradeoffs that can get pretty complex to explain. Essentially, anything that's commonly described as functional will be good for learning functional programming, don't worry about it*. The only people who discount "impure" or "functional-ish" languages are basically fundamentalists. *: However, learning a pure functional language as an intro to functional programming can be good for you as it doesn't allow you to intentionally or accidentally fall back into an imperative mode, instead forcing you to think functionally. However, as an introductory language, I'd recommend Elm - it is purely functional, but it's easy to do neat stuff with it since it runs in a browser and the author of the language puts a heavy emphasis on making it easier to learn. Elm's model of I/O is much easier to wrap your head around than Haskell's, in my opinion, which can be a major stumbling block in Haskell.
|
# ¿ May 1, 2015 22:29 |
|
QuantumNinja posted:Question about Elm: how would I go about making an Elm application interact with a database backend? The 'easiest' way I can imagine from the API is to use JSON to post requests to some server-side script and get the results back. Is there an approach (maybe as a library or tutorial) that doesn't require doing something like that for user login authentication? Maybe the Firebase bindings? That's about all I know of.
|
# ¿ Jul 1, 2015 03:27 |
|
Ralith posted:Maybe, I admit I don't follow community news very closely. I think it's pretty difficult to go wrong just installing stack directly, though. The important thing is to not be using raw cabal install. Yeah, cabal-install is hideously broken. Stack actually works, instead of breaking everything constantly.
|
# ¿ Mar 15, 2016 19:21 |
|
Walh Hara posted:I honestly have no idea if these posts about using a Linux VM are sarcastic or not. I've certainly never done such a thing and don't think it's a valid reply to the criticism of "installing a good IDE should not be so difficult". Most non-mainstream languages target Linux primarily, with Windows being very much a second class citizen. I use a Linux VM for development more often than not. I agree it's not a good response, but it's just the state of things. Debugging Haskell is, last I checked, in a pretty sad state. It's a pretty hard problem to solve due to the lazy evaluation.
|
# ¿ Mar 16, 2016 02:29 |
|
Hughmoris posted:Poking around Haskell and Functional programming by reading the "Learn You A Haskell" book. In one of the earlier sections, its talking about syntax in functions. It has this example: I would say that as something like "From any Integral type to String." The first part in parentheses indicates that a must implement the type class Integral, then the rest reads like a normal type signature, with that restriction.
|
# ¿ Mar 21, 2016 02:39 |
|
tazjin posted:I second this. Elixir specifically is a very approachable language (Elm maybe a little less so), but the combination has been a very effective tool for lifting programmers out of the dark pit filled with Javascript and Ruby. Elm is by far the most approachable purely functional language, and arguably one of the more approachable languages in general because the compiler errors are really, really good, which sounds silly, but given how much of learning new programming concepts is changing things and seeing what works, having the compiler explain very clearly why some things won't work and give suggestions on how to fix it is super helpful for learning. Arcsech fucked around with this message at 21:49 on Apr 27, 2016 |
# ¿ Apr 27, 2016 21:46 |
|
tekz posted:How does elm compare to say, using react+redux, which I really like. The architecture and thought process is similar between the two. The main difference is that Elm has a strong static type system, and encodes IO in the type system, kinda like Haskell - although it does so in a very different (and in my opinion, easier to understand) way.
|
# ¿ Apr 30, 2016 17:12 |
|
VikingofRock posted:Me too! I also liked the [1..5] syntax and back ticks. I suppose I can see the argument for removing all three though. The [1..5] syntax was nice, but I'm not too put out by losing it. Backticks I could go either way on, I can definitely see the simplicity of just encouraging |>. Good riddance to x' style variable names though, they're awful and don't communicate anything meaningful. But then, I also hate point-free style, so I'm somewhat out of step with a lot of Haskellers anyway.
|
# ¿ Nov 15, 2016 20:39 |
|
Maluco Marinero posted:I want to look into erlang or elixir for web development, after having a lot of experience with Python. My main usage will be building stuff bigger than the stuff I use Django for, so essentially I want to figure out the OTP stuff so I can make good use of the hardware I have with at least security in the knowledge that scaling won't be so bad as splitting up a monolith. If you want to do web dev in the Erlang ecosystem, Elixir + Phoenix is almost certainly what you want, especially coming from Python. Phoenix is very user-friendly, and it's far and away got the most users and the largest community of anything on the BEAM (Erlang VM). Programming Elixir and Programming Phoenix are both pretty good books to get started with Elixir. The downsides of using Elixir rather than Erlang:
|
# ¿ Feb 4, 2017 23:40 |
|
Colonel Taint posted:But... what's the different between 'extending the language' and building an API/library then? I've read McCarthy's paper and I realize the whole thing is built from a fairly basic foundation, which is cool in itself, but I keep getting hung up about that particular choice of words, especially when multiple authors use it to refer to defining functions. I can kind of seeing it make sense when talking about macros. Maybe I just haven't reached lisp nirvana yet. I mean, that's basically the point: Adding new syntax is as simple as adding a library. Consider Clojure's arrow macro: code:
code:
Another good example is Clojure's core.async, which implements a concurrency model similar to Go, but with no need for language support: It's just a library. And you can do this all pretty easily and safely, because the language is written in the same data structures you use for "normal" data. So yes, it's "just" macros, but it's really, really drat good macros.
|
# ¿ May 4, 2017 00:10 |
|
|
# ¿ Apr 29, 2024 08:24 |
|
Doc Hawkins posted:That's JavaScript. Interestingly, what became JavaScript was originally supposed to be Scheme, until Netscape decided that their scripting language had to look like Java. Basically JavaScript is what you get if you take Scheme and gently caress it up horribly by trying to squeeze it into a Java suit over the course of 10 days Arcsech fucked around with this message at 05:51 on May 7, 2017 |
# ¿ May 7, 2017 05:47 |