|
Carbon dioxide posted:Hey folks, I'm currently familiar with Java 8's support for functional programming with some basic knowledge of rx Java. Twitter's Scala School was great but is now painfully out of date. I'm sure there's a tutorial somewhere that's reasonably current. Akka's docs are pretty good if you're want to sit down and read through them, although terrible if you want to google something.
|
# ? Jul 19, 2017 00:33 |
|
|
# ? May 15, 2024 03:20 |
|
Does Twitter use Scala anymore? IIRC they started moving away from it at some point.
|
# ? Jul 23, 2017 02:37 |
|
Beamed posted:Does Twitter use Scala anymore? IIRC they started moving away from it at some point. They're still using it
|
# ? Jul 23, 2017 03:37 |
|
Are they still on 2.8?
|
# ? Jul 23, 2017 21:58 |
|
Sedro posted:They're still using it But are they still making new things with it or just maintaining things they can't bear to replace
|
# ? Aug 2, 2017 15:10 |
|
I'm trying to create a lexer using leex in Erlang 19/Elixir. I'm having problems matching angle brackets. The lexer compiles fine, but trying to let the string ">" results in an error: No function clause matching in lists.sublist/2 The following arguments were given to lists.sublist/2: #1 ">" #2 1 Pretty sure the angle bracket is screwing with the string formatting in Erlang. Anyone have an idea how to parse angle brackets? What am I screwing up?
|
# ? Aug 25, 2017 21:22 |
|
Hypnobeard posted:I'm trying to create a lexer using leex in Erlang 19/Elixir. I'm having problems matching angle brackets. The lexer compiles fine, but trying to let the string ">" results in an error: That looks like Elixir syntax; Elixir strings are actually Erlang binaries by default, and are incompatible with the string module. Try binary:part/2 or one of the string module functions (starting OTP-20 the one in Erlang supports unicode properly)
|
# ? Aug 25, 2017 21:41 |
|
MononcQc posted:That looks like Elixir syntax; Elixir strings are actually Erlang binaries by default, and are incompatible with the string module. Try binary:part/2 or one of the string module functions (starting OTP-20 the one in Erlang supports unicode properly) Yes, it is from Elixir, though I'm still calling the Erlang directly. Ahhh.. durr, need to pass a char list in instead of an Elixir string. The simplest things...
|
# ? Aug 25, 2017 23:44 |
|
205b posted:
|
# ? Aug 29, 2017 22:20 |
|
can someone motivate me to learn clojure? what can it do better? a demonstration would be nice. i keep telling myself to learn it but i cant seem to find value in it
|
# ? Aug 30, 2017 01:22 |
|
timick posted:The problem is the the recursive definition of leafPairs, which depends on parents which depends on leafPairs and so on. Is it a problem specifically because I'm trying to pattern match in getParents? Otherwise, I thought mutually dependent declarations were ok.
|
# ? Aug 30, 2017 08:45 |
|
Shinku ABOOKEN posted:can someone motivate me to learn clojure? what can it do better? a demonstration would be nice. The value I found in Clojure is 1. it looks cool and Lisp is cool 2. I wanted to get better at it. Other than that, you can pretty much say for 99% of everything "why would I want to do this when I can already do it with X?", so I can't really help you there cause I'm very similar to you in that regard Trying to psyche myself up to try making Doom WADs in a very similar fashion, actually.
|
# ? Aug 30, 2017 10:15 |
|
205b posted:Is it a problem specifically because I'm trying to pattern match in getParents? Otherwise, I thought mutually dependent declarations were ok. I'm not sure what you're after but would it be enough to have a leaf that looks like this instead? code:
|
# ? Aug 30, 2017 19:43 |
|
Shinku ABOOKEN posted:can someone motivate me to learn clojure? what can it do better? a demonstration would be nice. It will improve your Java stacktrace reading skills Seriously though, my main reason for learning Clojure was the interactive development style it allows, with the REPL you can inspect and incrementally change stuff in a running application, which is way more fun than the edit/compile/run cycle most languages offer. It also has nice datastructures that can be read & printed easily, which is super nice for debugging. The syntax is also awesome. The parentheses are weird at the beginning, some editors are capable of editing S-expressions directly, (im using Emacs with the paredit plugin) the learning curve is big, but once you get the hang of this, the parentheses are actually an advantage, as they give you a way to edit based on the structure of the code. See a demo here: https://www.youtube.com/watch?v=D6h5dFyyUX0
|
# ? Aug 30, 2017 22:09 |
|
timick posted:It has to do with the way that you've defined your tree. To create the parent node you need two child nodes, to create a child node you need a root node. Evaluating the tree will loop forever. Keep in mind that the parent field in a node is not a pointer or a reference to the parent node, it is a new copy of the parent node (which in turn will have new copies of child nodes...). I did need a distinct value for each node, but it turned out I could get away with a singly-linked tree, so I went with that. Just trying to wrap my head around what I did wrong. I think I get it now! What you're saying is that let x = 0:y; y = 1:x in x doesn't give you two nodes pointing at each other, but a chain of infinitely many nodes. As a followup, how come length (let x = 0:y; y = 1:x in x) pegs my processor but my original example just sat there doing nothing?
|
# ? Aug 31, 2017 08:15 |
|
205b posted:I did need a distinct value for each node, but it turned out I could get away with a singly-linked tree, so I went with that. Just trying to wrap my head around what I did wrong. I think I get it now! What you're saying is that let x = 0:y; y = 1:x in x doesn't give you two nodes pointing at each other, but a chain of infinitely many nodes. Contrast the following two pieces of code. x = 0:y; y = 1:x; main = print $ take 5 x outputs [0,1,0,1,0]. For the purpose of answering your question, you can safely pretend that it: looks at the first entry of x and sees it's known to be 0. Then it looks for the second entry of x, which is defined to be the first entry of y, which is known to be 1. Then it looks at the next entry of x, which is the second entry of y, which is the first entry of x, known to be 0...fourth must be 1...fifth must be 0, and we're done. Since that doesn't ask the computer to do anything infinite, there's no problem with the theoretically-infinite definition of x. But change main to print $ length x and it would have to do something along the lines of: Check if x has a first entry. It does, so the length is at least 1. The next entry, if any, would be the first entry of y, which exists (it's 1), so the length is at least 2. The next entry, if any would be the first element of x again (by the definition of y), so the length is at least 3...at least 4...5...6...7... and it would never stop.
|
# ? Aug 31, 2017 11:09 |
|
205b posted:I did need a distinct value for each node, but it turned out I could get away with a singly-linked tree, so I went with that. Just trying to wrap my head around what I did wrong. I think I get it now! What you're saying is that let x = 0:y; y = 1:x in x doesn't give you two nodes pointing at each other, but a chain of infinitely many nodes. I hadn't noticed that it didn't consume any CPU in ghci, but I suspect it has to do with that the RTS can detect that something is wrong and stops executing. When I build and run your program it will fail with "project-exe: <<loop>>".
|
# ? Sep 1, 2017 08:15 |
|
dirby posted:... Sure, got that part, I was just unclear on whether the recursive definition would result in a cyclical list or an infinite list. It sounds like it's the latter, which explains why my tree didn't work. Thanks both for the help!
|
# ? Sep 1, 2017 08:51 |
|
timick posted:I'm not sure what you're after but would it be enough to have a leaf that looks like this instead? Isn't that just CoFree?
|
# ? Sep 3, 2017 01:10 |
|
I asked this in the general questions thread and was recommended to ask here: In the year 2017, what are the compelling arguments to choose between Common Lisp, Scheme and Clojure for side project webdev? Context: I get the impression that CL spec is a touch outdated. I like functional programming, pattern matching and algebraic data types are fantastic. I write c#/js by day. Oh great Lisp greybeards, lend me your knowledge!
|
# ? Sep 28, 2017 12:00 |
|
strange posted:I asked this in the general questions thread and was recommended to ask here: Side project web dev, specifically? Clojure by far. Clojure has a pretty robust selection of web development libraries ranging from basic HTTP handling, to SQL abstraction, to API management, and there's at least one legit web dev book to learn from. Disclaimer: I am basically the opposite of a greybeard, so take my advice with a grain of salt. But, I have had good experiences doing web dev in Clojure!
|
# ? Sep 28, 2017 13:30 |
|
Clojure is the most convenient for web development because of its robust ecosystem, specifically the Luminus framework. It's more of a set of libraries with some basic scaffolding than anything Rails-like, which is why it's good. Programming in Clojure makes using Clojurescript more convenient, which is also a substantial benefit. The main downside of Clojure is that the error messages suck. Common Lisp is good, too. SBCL can produce really fast binaries, there's a good webserver (woo), and plenty of other good tooling, including frameworks. The only downside I can think of is that reading the spec kinda sucks and that trying to figure out where your compiler diverges from the spec also sucks, but usually it's not a big deal in practice. Every major Scheme implementation has at least a web server available for it, but I'm not aware of any that have a full-featured web stack with sessions, routing, and everything already well-considered the way Clojure has with Luminus. I'm on a personal crusade to make this happen for Racket, although Racket will be hampered by its execution speed for the forseeable future. All of these languages have superb Emacs support, fwiw
|
# ? Sep 28, 2017 19:21 |
|
Clojure is very nice but I'm going to recommend Racket as well. Those are probably your two best bets. SBCL is blazing-fast and battle-tested but shows its age, and Lisp-2 semantics were never not awful.
|
# ? Sep 29, 2017 22:05 |
|
rt4 posted:Clojure is the most convenient for web development because of its robust ecosystem, specifically the Luminus framework. And the whole Java thing. quote:Racket will be hampered by its execution speed for the forseeable future. Racket may be slower than Clojure but it's more than adequate when compared to the scripting languages that dominate web development. I would also say that, depending on the use-case, Clojure's boot time may make it a non-starter.
|
# ? Sep 29, 2017 22:08 |
|
Racket is basically the best Lisp
|
# ? Sep 30, 2017 00:05 |
|
I've done several web apps with Clojure and Luminus and have no regrets.
|
# ? Oct 1, 2017 13:52 |
|
My one gripe with Clojure is the lack of an ORM, which is entirely because my SQL skills are relatively lacking.
|
# ? Oct 1, 2017 15:38 |
|
Pollyanna posted:My one gripe with Clojure is the lack of an ORM, which is entirely because my SQL skills are relatively lacking. Be the change you want to see in the world
|
# ? Oct 1, 2017 15:39 |
|
Pollyanna posted:My one gripe with Clojure is the lack of an ORM, which is entirely because my SQL skills are relatively lacking. Or write something like dapper for it. Good news: SQL skills are still relevant, even after all these years. And it does not seem to be going away anytime soon. So dig in!
|
# ? Oct 1, 2017 15:59 |
|
There is http://sqlkorma.com which is somewhat close but after looking is much closer to straight sql... The defentity macros seem to stray closer to orm style things though. I've never actually used it so idk how ready it is to use for a real app, but I've had it in mind for whenever I wanna do a clojure app
|
# ? Oct 1, 2017 17:36 |
|
I'm not a Clojure developer, but if I were to start a new database-backed project in Clojure I wouldn't skip the chance to use Datomic.
|
# ? Oct 1, 2017 17:54 |
|
True. Datomic is a better fit overall for Clojure, I just don't have a whole lot of familiarity with it. It makes sense to lean on it first, though.
|
# ? Oct 1, 2017 21:14 |
|
The best ORM is no ORM
|
# ? Oct 1, 2017 23:46 |
|
xtal posted:The best ORM is no ORM Fair enough, and I do remember this sort of SQL templating happening when I made stuff with Luminus.
|
# ? Oct 2, 2017 00:13 |
|
xtal posted:The best ORM is no ORM yesql posted:Your database doesn't stick to the SQL standard - none of them do - but Yesql doesn't care.
|
# ? Oct 2, 2017 11:50 |
|
Pollyanna posted:Side project web dev, specifically? Clojure by far. Clojure has a pretty robust selection of web development libraries ranging from basic HTTP handling, to SQL abstraction, to API management, and there's at least one legit web dev book to learn from. rt4 posted:Clojure is the most convenient for web development because of its robust ecosystem, specifically the Luminus framework. It's more of a set of libraries with some basic scaffolding than anything Rails-like, which is why it's good. Programming in Clojure makes using Clojurescript more convenient, which is also a substantial benefit. The main downside of Clojure is that the error messages suck. xtal posted:Clojure is very nice but I'm going to recommend Racket as well. Those are probably your two best bets. SBCL is blazing-fast and battle-tested but shows its age, and Lisp-2 semantics were never not awful. Thanks for the replies. It sounds like Clojure is the quickest choice to go from zero to something working. I'm interested in the recommendations for Racket. The official website plays up the DSL writing aspect, how much is that used in day-to-day coding?
|
# ? Oct 3, 2017 18:43 |
|
|
# ? May 15, 2024 03:20 |
|
I'm halfway through Beautiful Racket, a guide to DSL writing, and it seems pretty cool and not that hard. I haven't done anything practical with it yet, but I plan to use it to build a Racket equivalent to Clojure's HugSQL. One DSL that Racket users will encounter frequently is Scribble, the Racket documentation generator. It's easy to work with and generates superb docs. When you build a package for the Racket package repository, the packaging system also builds and hosts your docs, so you'll definitely use it if you do any open source work in Racket. One more Scheme I should've mentioned for web work is Chicken. I haven't used it myself, but it apparently has a following for its web capabilities. The website is nice and easy to navigate and it has its own package manager.
|
# ? Oct 4, 2017 01:38 |