Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Bongo Bill
Jan 17, 2012

aerique posted:

It's been on my mind for a while to write a Common Lisp implementation for haXe since haXe can target so many platforms.

I've used haXe for a couple of small projects and it is pretty bearable to work with and I was pretty surprised by the Flash API. I had expected some kind of monstrosity but it was nice.

I found a vaguely Lisp-like language implemented in haXe called Orbit, but I know nothing about it. It's evidently pretty far from Common Lisp, though, and it doesn't look very well-supported.

Adbot
ADBOT LOVES YOU

aerique
Jul 16, 2008

Bongo Bill posted:

I found a vaguely Lisp-like language implemented in haXe called Orbit, but I know nothing about it. It's evidently pretty far from Common Lisp, though, and it doesn't look very well-supported.

It's worth a look, although I always wonder why people don't just implement CL[1] or at least Scheme instead of creating their own little Lisp. Creating your own Lisp has worked for Clojure, QI and what else?

[1] I can understand not implementing CL since it's such a huge beast.

negationix
May 1, 2007

aerique posted:

It's worth a look, although I always wonder why people don't just implement CL[1] or at least Scheme instead of creating their own little Lisp. Creating your own Lisp has worked for Clojure, QI and what else?

[1] I can understand not implementing CL since it's such a huge beast.

It's probably more fun to spin your own version with your own little quirks than just implement something that has already been done. It's completely another question if it makes any sense though.

PrBacterio
Jul 19, 2000

aerique posted:

It's been on my mind for a while to write a Common Lisp implementation for haXe since haXe can target so many platforms.
Keep in mind though that Common Lisp is a freaking huge language. Writing a full implementation of it would be a major project even for a fairly large team of programmers, no matter the platform.

aerique
Jul 16, 2008

PrBacterio posted:

Keep in mind though that Common Lisp is a freaking huge language. Writing a full implementation of it would be a major project even for a fairly large team of programmers, no matter the platform.

Yes, that's true. Going against what I said earlier about people making their own Lisps, I'd make it for myself first building what I need and making sure SICL works. Then I would make sure packages I need (Slime, sockets) are supported, but this is already a huge step.

There's a reason I never started on this project ;-)

Posting Principle
Dec 10, 2011

by Ralp
Can anyone recommend an easily embeddable scheme interpreter for C/C++?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Chicken Scheme is relatively easy to embed and is a high-quality implementation.

weird
Jun 4, 2012

by zen death robot

Plorkyeran posted:

Chicken Scheme is relatively easy to embed and is a high-quality implementation.

I can vouch for Chicken too. If that doesn't work, Guile's been pretty nice since 2.0.

Beef
Jul 26, 2004
Just in case you meant embeddable as in 'embedded hardware', check out Armpit scheme: http://armpit.sourceforge.net

We have been using it for educational purposes for a few years now, using ARM7 micro-controllers. It's about 20k lines of handwritten assembly, a tiny footprint and fast enough for most purposes. We also added some native functions to drive a LCD screen ourselves.

Otherwise, I also heard from good sources that Chicken Scheme and the new Guile versions are great. Bigloo is also an option, especially if you also want to embed it in Javascript.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
PragProg just announced a new book about Clojure and web development, both things I do a lot of every day. Looks like it'd be a darn good intro for those of you who don't know where to start otherwise: http://pragprog.com/book/dswdcloj/web-development-with-clojure

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal
Just FYI O'Reilly has 50% off all ebooks and videos right now through Sep. 10.

Clojure Programming is arguably the best clojure book out right now and Clojure Inside Out is a 6 hour video series that looks pretty quality.

leftist heap
Feb 28, 2013

Fun Shoe
Anyone have any experience getting a full clojure/emacs/slime/swank/lein stack up and running on Windows? Is there a good guide out there? Am I in for hell? Would it be easier to install an Ubuntu VM than go down this road? I know years ago when I tried it was a bit of a nuisance.

pgroce
Oct 24, 2002
I don't have Windows experience, but swank-clojure has been deprecated in favor of nrepl and nrepl.el. (Sorry no link, I'm on my phone.)

I imagine that makes things a lot easier....

leftist heap
Feb 28, 2013

Fun Shoe
Good to know. Another couple questions:

I have Programming Clojure 2nd Edition, which covers Clojure 1.3. I see that 1.5 is the latest version though. Is it worth it to seek out a more up-to-date reference? Took a quick look through the change logs for both 1.4 and 1.5 and it seems like I should be safe.

Anyone have recommendations for a persistent data store with good Clojure integration? What's Clojure's support for MongoDB like? CouchDB? It's just for a toy project, so my requirements aren't particularly demanding.

Tequila Bob
Nov 2, 2011

IT'S HAL TIME, CHUMPS

rrrrrrrrrrrt posted:

Anyone have any experience getting a full clojure/emacs/slime/swank/lein stack up and running on Windows? Is there a good guide out there? Am I in for hell? Would it be easier to install an Ubuntu VM than go down this road? I know years ago when I tried it was a bit of a nuisance.

First, install the JDK version 1.7.

Second, get the Leiningen batch file and make sure it is available on your path. Run "lein self-install" at the command prompt. (Apparently Leiningen now offers a Windows installer; I have no experience using it.)

Third, obtain Emacs, preferably at least version 24.

Fourth, make sure your Emacs can contact the Marmalade repo. Instructions are available at that link.

Finally, M-x package-refresh-contents, and then M-x package-install the following packages: clojure-mode, nrepl, paredit, rainbow-delimiters.

pgroce
Oct 24, 2002

Tequila Bob posted:

First, install the JDK version 1.7.

Second, get the Leiningen batch file and make sure it is available on your path. Run "lein self-install" at the command prompt. (Apparently Leiningen now offers a Windows installer; I have no experience using it.)

Third, obtain Emacs, preferably at least version 24.

Fourth, make sure your Emacs can contact the Marmalade repo. Instructions are available at that link.

Finally, M-x package-refresh-contents, and then M-x package-install the following packages: clojure-mode, nrepl, paredit, rainbow-delimiters.

Then turn off paredit. :v:

ac-nrepl is also nice-ish if you use the auto-complete package. It doesn't seem to find things that I should think are in scope, but ah well.

Great list of things to tweak in the Configuration section of the nrepl.el README.

e: Is there seriously not a Clojure thread? Wow.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

rrrrrrrrrrrt posted:

Good to know. Another couple questions:

I have Programming Clojure 2nd Edition, which covers Clojure 1.3. I see that 1.5 is the latest version though. Is it worth it to seek out a more up-to-date reference? Took a quick look through the change logs for both 1.4 and 1.5 and it seems like I should be safe.

Anyone have recommendations for a persistent data store with good Clojure integration? What's Clojure's support for MongoDB like? CouchDB? It's just for a toy project, so my requirements aren't particularly demanding.

If you're in the market for a SQL driver then clojure.jdbc is very solid, we use it quite comfortably in production.

Civil Twilight
Apr 2, 2011

I've been using Korma for a few small tools at work and been very happy with it.

leftist heap
Feb 28, 2013

Fun Shoe
Blargh. For whatever reason when I set up Emacs24W with Marmalade it doesn't list or show any of the actual packages from the repo, even though I've done M-x package-refresh or whatever. Anyone know what could be going wrong there? M-x package-list doesn't show any of the packages I would expect, like nREPL or SLIME. I'm getting close to just booting into Ubuntu to do Clojure stuff, but I really don't like Ubuntu that much.

Also, is it worth using SLIME these days for Clojure, or is nREPL enough?

Tequila Bob
Nov 2, 2011

IT'S HAL TIME, CHUMPS

rrrrrrrrrrrt posted:

Blargh. For whatever reason when I set up Emacs24W with Marmalade it doesn't list or show any of the actual packages from the repo, even though I've done M-x package-refresh or whatever. Anyone know what could be going wrong there? M-x package-list doesn't show any of the packages I would expect, like nREPL or SLIME. I'm getting close to just booting into Ubuntu to do Clojure stuff, but I really don't like Ubuntu that much.

Make sure you're putting the Marmalade settings in a file that your Emacs is actually loading. ~/.emacs.d/init.el is a good default for Windows. Also, check your proxy settings.

rrrrrrrrrrrt posted:

Also, is it worth using SLIME these days for Clojure, or is nREPL enough?

nREPL is enough. SLIME is still good for other Lisps.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Civil Twilight posted:

I've been using Korma for a few small tools at work and been very happy with it.

I've been using clojureql but Korma seems way more active/up to date. I'm probably going to do the ol' switcheroo.

Meiwaku
Jan 10, 2011

Fun for the whole family!

SavageMessiah posted:

Joy of Clojure 2nd edition is arguably the best clojure book out right now

Fixed that for you.

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal

Meiwaku posted:

Fixed that for you.

Joy of clojure 2nd edition is OUT yet, so THERE. :colbert:

Seriously though that one is really good too but it lacks all the stuff on how to handle the java ecosystem and build stuff and all the other ancillary stuff the JoC just glosses over.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

trex eaterofcadrs posted:

I've been using clojureql but Korma seems way more active/up to date. I'm probably going to do the ol' switcheroo.

Korma's neat and seems to be the way to go if you need to procedurally generate queries, but I've run into a couple of issues with it as far as using Postgres-specific datastructures was concerned, more specifically arrays. Clojure JDBC handles those ok.

I also like JDBC's option to pass in row and column transformers, which are really handy if you need to cast certain columns to the correct data type (joda time for timestamps, for example) or if you need to standardize map keys. As in, idiomatic Postgres uses snake_case, Clojure keys should be in lisp-case.

It might handle those fine now, but when I looked a while ago it didn't, and you had to either hack it yourself or use someone else's (gfrederick's?) fork, which supported it.

leftist heap
Feb 28, 2013

Fun Shoe
Anyone using ac-nrepl for Emacs? I find it very, very slow. Useful, but super slow.

pgroce
Oct 24, 2002

rrrrrrrrrrrt posted:

Anyone using ac-nrepl for Emacs? I find it very, very slow. Useful, but super slow.

Yeah, I noticed this yesterday. It's slow enough that I'd usually disable it, but it's actually useful given the sheer volume of APIs in Java, so I'm torn.

I haven't tried it, but ac-nrepl-compliment might be faster.

leftist heap
Feb 28, 2013

Fun Shoe

pgroce posted:

Yeah, I noticed this yesterday. It's slow enough that I'd usually disable it, but it's actually useful given the sheer volume of APIs in Java, so I'm torn.

I haven't tried it, but ac-nrepl-compliment might be faster.

Gave that a whirl and it's much, much faster. Just FYI though, you'll need to include the linked library compliment in your project.clj for it to work. The author's instructions don't make that explicit.

Police Academy III
Nov 4, 2011
So core.typed is out, has anybody tried using it yet? I was thinking about going back and trying to do something in clojure again since the lack of typing was one of my big complaints with it (and also because writing java for a living is slowly sapping my will to live).

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Is there a specific scenario where dynamic typing doesn't work for you, or is this mostly a matter of personal preference?

I don't want to start a holy war of any sorts, but I've worked with very large C# projects for years (200+ engineers), and several years in much smaller Ruby/JS/Clojure and have done just fine without typing. I often hear counter-arguments to dynamic typing though (most notably latest QuakeCon's keynote), so I'm concerned that I'm simply not working with projects of sufficient complexity to understand the value of these arguments. As I mentioned, I haven't used something like Ruby at massive scale, although I know it's been done before. I think ESPN is Rails or something like that. I genuinely want to understand if perhaps I'm missing out and if I'm seriously going to be bitten in the rear end as size increases.

DreadCthulhu fucked around with this message at 04:21 on Sep 7, 2013

pgroce
Oct 24, 2002
I haven't been able to work on a large project with a strong static type system, but on smaller projects with, e.g., Haskell, it's been nice to know that certain things just can't happen (and therefore don't need to be tested). Thinking about how the type system should work also helps to "first solve the problem," in the words of John Johnson; by the time you've worked it out, you understand the components of the solution and their necessary operations, and wiring together is often much clearer.

It can go the other way too, of course. It's definitely easier to write some kinds of code with dynamic types. But that restriction buys you guarantees, and that can come in handy, too. Horses for courses.

Are there any strongly and/or statically typed lisps? Clojure is the only lisp I've worked with that even charitably meets that description. I suppose Chicken must, right?

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

pgroce posted:

I haven't been able to work on a large project with a strong static type system, but on smaller projects with, e.g., Haskell, it's been nice to know that certain things just can't happen (and therefore don't need to be tested). Thinking about how the type system should work also helps to "first solve the problem," in the words of John Johnson; by the time you've worked it out, you understand the components of the solution and their necessary operations, and wiring together is often much clearer.

It can go the other way too, of course. It's definitely easier to write some kinds of code with dynamic types. But that restriction buys you guarantees, and that can come in handy, too. Horses for courses.

How does that impact your testing habits? Are you mostly referring to not having to test types at the application boundaries because if the types are wrong you immediately error out rather than potentially letting the app get pretty deep before it blows up? I'm thinking a web app api scenario here.

pgroce
Oct 24, 2002

DreadCthulhu posted:

How does that impact your testing habits? Are you mostly referring to not having to test types at the application boundaries because if the types are wrong you immediately error out rather than potentially letting the app get pretty deep before it blows up? I'm thinking a web app api scenario here.

Again, I haven't worked on large projects with static types, but in smaller ones I did find I had to write a lot less defensive code and tests in the style of "What if you get this type of bad input?" User input still needs validation and (type-unsafe) conversion that needs to be aggressively tested, but at least that risk is isolated. Testing the rest of the code can focus more on correct behavior with valid inputs.

Web apps probably wouldn't get much leverage from types directly, except inasmuch as the validation could exist in one layer. (Which you could do in a dynamic language.) Indirectly, though, it would be nice to know that all the components that are wired together to make the app are known to get along, and to know it at compile time, before they serve any requests.

I hope I'm addressing your question. :)

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Yep, I appreciate the opinion!!

Also, defensive programming is a weird concept and I don't think anybody actually knows how it's different from offensive programming. See this.

DreadCthulhu fucked around with this message at 07:10 on Sep 7, 2013

aerique
Jul 16, 2008
It would be interesting to hear the opinions of the people working at ITA Software or those having worked on http://www.piano.aero/ (initially made by one guy) wrt to issues they have run into with typing.

It is hard to ignore Carmack, but on the other hand he doesn't have much experience with languages outside C / C++, although he is definitely working on that and large, complex systems have been built in at least Common Lisp so it would be good to hear the other side of the story.

Movac
Oct 31, 2012

pgroce posted:

Are there any strongly and/or statically typed lisps? Clojure is the only lisp I've worked with that even charitably meets that description. I suppose Chicken must, right?

Racket has a statically-typed variant that's compatible with the basic dynamic language. This was the biggest inspiration for Clojure's optional typing library.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
loving monads. If someone has a good tutorial or path to truly grokking them in Clojure, please share it.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Learn Haskell if you want monads to actually make sense.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

Plorkyeran posted:

Learn Haskell if you want monads to actually make sense.

I think Crockford compares that statement to saying "You need to learn Spanish to appreciate a burrito".

pgroce
Oct 24, 2002
Except burritos make sense outside Mexico and monads mostly don't make sense outside Haskell.

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

DreadCthulhu posted:

I think Crockford compares that statement to saying "You need to learn Spanish to appreciate a burrito".

Yet another reason not to listen to Crockford!

Trying to grok monads without using Haskell is like trying to grok OOP by implementing your own object system from scratch in R5RS without ever having used a language with built in support for OO. It's certainly not impossible, but it's not the route anyone would recommend.

  • Locked thread