Magus' Unixy Adventure (trigger warning, Blakey!)



  • So some time, possibly today, I'm going to try setting up a project. I want to build some kind of AI-ish thing, which will start out simple and dumb.

    For the sake of power, performance, and learning, I will be doing this in Lisp, specifically SBCL. Probably on Slackware or OpenSuse - Slackware has the best installer I've ever seen, and OpenSuse has worked pretty much everywhere I've tried it.

    But I'm a noob. I know it. Most of my programming has been OO, and I don't even know how OO anything AI should be, or how to use the CLOS. I'll essentially be going in blind.

    As primarily a C# developer, I consider types to be rather key in keeping methods from being used on types that make no sense, and I haven't got a clue how that works in lisp, or do any sort of organization or encapsulation.

    So, if anyone has any advice to keep me from falling down a few of the infinite invisible pitfalls I'll be facing, I'd be glad to hear it.


  • Discourse touched me in a no-no place

    @Magus said:

    Slackware has the best installer I've ever seen

    :popcorn:



  • Honestly, I've tried installing various versions of linux to play around with. Most of them have pretty much the same installer, nice and simple. But Slackware, despite having an installer that looks like an ancient DOS app, is incredibly configurable and easy to use.

    Anyway, I assume I'll want to get SLIME, and possibly set up eclipse or something, since I'd rather deal with eclipse + REPL (Eclisp?) than a simple text editor. I know, I know, Lisp == Emacs...


  • Discourse touched me in a no-no place

    Next question: Why Common Lisp? Is it because it's an AI project?

    Filed under: timepods



  • @Magus said:

    I want to build some kind of AI-ish thing, which will start out simple and dumb.

    How are you planning for it to end up?


  • Discourse touched me in a no-no place

    @CreatedToDislikeThis said:

    @Magus said:
    I want to build some kind of AI-ish thing, which will start out simple and dumb.

    How are you planning for it to end up?

    Complicated and dumb is my guess.



  • The first thing that jumps out to me are your odd choices. Don't you want to use something more relevant? SBCL and Slackware aren't great resume material. Debian (or, yeah, SUSE) and Clojure might be things you'll actually use.


  • Discourse touched me in a no-no place

    Also, if this is a serious question, comp.lang.lisp might be a better place for it.



  • I've always wanted to learn Lisp, and SBCL is the fastest one afaik. I'd rather deal with 'real macros' i think, but I'd be fine with trying out Clojure with LightTable if anyone thinks I'd have a better time.

    @CreatedToDislikeThis said:

    How are you planning for it to end up?

    @antiquarian said:

    Complicated and dumb is my guess.

    Well, um, preferably complicated and cool, but this isn't a very serious project, so probably.

    @Bort said:

    Debian

    I'm not a huge fan of most Debian distros for some reason. I'd probably use Fedora if I wanted to head that way.

    @antiquarian said:

    Also, if this is a serious question, comp.lang.lisp might be a better place for it.

    I'm trying to go in nearly blind, but I wanted to get a few warnings if possible. I just want to mess with things and learn.



  • @Magus said:

    I've always wanted to learn Lisp, and SBCL is the fastest one afaik.

    If you want something fast, why are you using a Lisp? To do functional programming?

    If you want something FP and fast, use Haskell (?).
    If you want something more relevant, but still Lisp-like, use Clojure.
    If you want something closer to home, use F#.
    If you want something "out there", use Shen.


  • Discourse touched me in a no-no place

    @Magus said:

    I'm trying to go in nearly blind

    That's a very reasonable goal.

    One thing I can tell you is that the de facto Lisp IDE is emacs. If you use slime, you get integration with the Lisp REPL, which can help with quick development and debugging. There's a similar project for Clojure, though Light Table is considered a reasonable alternative.


  • Discourse touched me in a no-no place

    @Bort said:

    If you want something fast, why are you using a Lisp?

    Lisp isn't necessarily slow and hasn't been for years. There are better reasons not to use Lisp.

    Filed under: we want quality trolling here



  • @Magus said:

    I want to build some kind of AI-ish thing, which will start out simple and dumb.

    Can you elaborate on what kind of AI-ish thing? AI is a pretty broad field.



  • @Bort said:

    If you want something fast, why are you using a Lisp? To do functional programming?

    I want to learn to think the Lisp way. I want to do something that may end up complex, so I chose the fast one.

    @Bort said:

    If you want something FP and fast, use Haskell (?).

    I've considered it, and this would help with the whole typing issue, but I don't think it will quite give me the simplicity I need.

    @Bort said:

    If you want something more relevant, but still Lisp-like, use Clojure.

    I am considering it.

    @Bort said:

    If you want something closer to home, use F#.

    A good point, but I feel like I'll get bored faster for some reason. Like how I had a better time learning Japanese than Spanish, because it was more different.

    @antiquarian said:

    One thing I can tell you is that the de facto Lisp IDE is emacs.

    Yes, I know. But then I have to learn all of Emacs. That's why I'm considering Clojure and LightTable, or SBCL and Eclipse.

    @Kian said:

    Can you elaborate on what kind of AI-ish thing? AI is a pretty broad field.

    I'm going to start by making a heuristic-based system that takes tiles and paths to a goal tile. Then I'll add obstacles, buttons, etc, and see what I end up with. I plan on just adding on bits when I'm bored and trying to figure out how to teach it to solve specific problems. The only AI I've done was some basic prolog at uni, and I hated it but found the concepts intriguing.

    Again, this is a really non-serious project. I have my game project in C# still, I just want to mess around learning something completely unrelated.

    I may just end up with a bad, broken version of dwarf fortress, but I want to see what happens.



  • @antiquarian said:

    Lisp isn't necessarily slow and hasn't been for years.

    True, but it's also not fast. Performance isn't a good reason to avoid most lisps, but it's not a good reason to use a particular one, I don't think.



  • So, ideally I'd like to use a Lisp-1, and I don't know about very many of them, but if you know one that's better than SBCL, I'd be glad to hear it. Really, Common Lisp shouldn't be too different no matter which I choose. I just don't want to get down the road and think, 'If only I was using a Lisp-1' - the reverse of which is extremely unlikely.



  • @Magus said:

    I just don't want to get down the road and think, 'If only I was using a Lisp-1' - the reverse of which is extremely unlikely.

    Lisp-1 is also more similar to the way most other languages work. Another reason not to go with CL.



  • Okay, maybe my memory is failing me, but I was pretty sure CL was Lisp-1, while the Scheme family is Lisp-2. It's been over a year since I looked this stuff up, but I know I'd rather not go Schemeways.

    EDIT: Strike that, reverse it. Thanks, Wikipedia. Yep, I still like CL better.



  • On second thought, maybe those hygenic macros do make sense, after reading up some more. I'd be fine with a scheme variant. But Clojure sounds worse than I remember: It runs on Java and is bad at macros. All I know is that It's not Lisp if the macros are lame.


  • area_pol

    If you want to do advanced things like AI / machine learning, maybe choose the most fitting AI library first and then use it's language? If you choose a rarely used language first, it might be hard finding a library for it.

    Also, what is with those numerous versions of Lisp?


  • Discourse touched me in a no-no place

    @Magus said:

    Yes, I know. But then I have to learn all of Emacs.

    Not true, and I'm not sure learning all of Emacs is possible in any case. You just need to go through the Emacs tutorial and look at a slime tutorial on YouTube. After that you should be ready to code.



  • @Adynathos said:

    maybe choose the most fitting AI library first and then use it's language?

    Because I want to do It myself. If I had a more serious goal, I would do that or just use a language I know, but this is s much because I want to learn lisp a anything else. As for the versions, it's a language that's been around since the 60s, so everyone had their own idea of how to do It right.



  • Honestly though, I installed dandelion in eclipse, and It installed clisp. I couldn't get It working on Korora, which was the only one of the Linux disks I had on hand that didn't puke on the uefi., because It complained about permissions. So I ended up having more luck with lisp on windows. It set up a project system and a repl within the ide, so I have what I need.



  • So anyway, I have a strong urge to rant about the whole Dandelion on linux thing. Dandelion supports SBCL and CLISP. SBCL is linux only, Clisp is crossplatform. When I installed Dandelion, it defaulted to Clisp on linux, and when I tried it get it to interpret any code, I got some error about not having permission to run some kind of Clisp exe. I mean a real, Windows exe file. On linux. So I tried setting it to SBCL, and it gave me the same error with a different file. "Fine," I thought, "I'll just run it as root. Yeah, that's dumb, but I don't care about this install or this machine, so here goes. WHAT. WHAT DO YOU MEAN I CAN'T RUN ECLIPSE EXCEPT AS A LOCAL USER!? AAAAGH!" - so that's when I switched to Windows.

    On Windows, I went to download Eclipse. It only came in zip form, which was kind of dumb, but I can deal with that. I try launching it, "Error, you don't have javaw in your PATH." - @blakeyrat speaks truth once more: that's wrong and broken and they should feel bad for doing it.

    So I try installing some kind of JDK. "Lets try EE, I haven't used Java in forever, no idea what I'm doing." So, um, this is a zip file that only includes glassfish. THANK YOU, ORACLE, EVERYONE LOVES YOU AND ALL YOUR SOFTWARE!

    Installed Java SE, ran eclipse, installed the plugin, everything worked great. So: Bad software regardless of OS, yet it somehow works better on Windows, where it's much harder to install. I don't even know.

    Though I like Dandelion. It's simple.


  • area_pol

    You seem to have encountered many problems in a seemingly simple thing.
    As an experiment, I attempted to install Lisp too, and it turns out simple:

    sudo apt-get install clisp
    clisp test.lisp
    

    And it works, the biggest problem was how to write "hello world" in Lisp :)


  • Discourse touched me in a no-no place

    @Magus said:

    So anyway, I have a strong urge to rant about the whole Dandelion on linux thing. Dandelion supports SBCL and CLISP. SBCL is linux only, Clisp is crossplatform. When I installed Dandelion, it defaulted to Clisp on linux, and when I tried it get it to interpret any code, I got some error about not having permission to run some kind of Clisp exe. I mean a real, Windows exe file. On linux. So I tried setting it to SBCL, and it gave me the same error with a different file. "Fine," I thought, "I'll just run it as root. Yeah, that's dumb, but I don't care about this install or this machine, so here goes. WHAT. WHAT DO YOU MEAN I CAN'T RUN ECLIPSE EXCEPT AS A LOCAL USER!? AAAAGH!" - so that's when I switched to Windows.

    It's too late for you at this point, but I should probably explain what I meant by saying that Emacs is the de facto IDE for Lisp, just in case anyone reading this thread wants to try Lisp. What I meant was that if you go to any Lisp newsgroup or forum with experienced Lisp users, they will tell you to use Emacs, unless you are using one of the commercial implementations. The commercial implementations include their own IDEs.


  • area_deu

    You know which Linux doesn't puke on UEFI?
    Ubuntu.



  • Eh? (print "Hello World")

    Installing Lisp isn't hard regardless of your OS. Installing Clisp through apt or cygwin isn't the issue. The issue is setting up a good environment to use it in. I wanted to have simple project management and a REPL alongside my text editing window, so I got it. It just renewed my hatred for Eclipse, which is a mess no matter what language you use.

    @antiquarian said:

    It's too late for you at this point, but I should probably explain what I meant by saying that Emacs is the de facto IDE for Lisp, just in case anyone reading this thread wants to try Lisp. What I meant was that if you go to any Lisp newsgroup or forum with experienced Lisp users, they will tell you to use Emacs, unless you are using one of the commercial implementations. The commercial implementations include their own IDEs.

    I don't think anyone could possibly think you meant anything else, but Emacs is the de facto text editor for many people regardless of the language. But 'what everyone else uses' isn't a good enough reason, imo. Emacs itself is mostly Lisp, and so it handles it well. But you still have to deal with their way of doing things. I'm more comfortable in Eclipse, because it's like other editors and IDEs I've used. Apart from it, there really only is Emacs or Vim for Lisp. Everything else vomits all over the formatting, which is the simplest of any language. I've never understood this.

    @aliceif said:

    You know which Linux doesn't puke on UEFI?Ubuntu.

    You know what Korora and Ubuntu have in common? Debian. This is why it had no trouble either. Too bad Eclipse is broken on Linux.


  • area_deu

    @Magus said:

    Korora

    I thought they were a Fedora-based thing last time I checked.
    Huh.



  • Ah, they are, I'm wrong.


  • Discourse touched me in a no-no place

    @Magus said:

    I don't think anyone could possibly think you meant anything else, but Emacs is the de facto text editor for many people regardless of the language. But 'what everyone else uses' isn't a good enough reason, imo. Emacs itself is mostly Lisp, and so it handles it well. But you still have to deal with their way of doing things. I'm more comfortable in Eclipse, because it's like other editors and IDEs I've used. Apart from it, there really only is Emacs or Vim for Lisp. Everything else vomits all over the formatting, which is the simplest of any language. I've never understood this.

    OK, I'll rephrase: If you're coding in Lisp and you're not using Emacs, you're gonna have a bad time.



  • @antiquarian said:

    OK, I'll rephrase: If you're coding in Lisp and you're not using Emacs, you're gonna have a bad time.

    Only if you ask elitist Emacs zealots for help. All you need for Lisp is an editor that handles formatting right and a REPL. Everything else is a nice-to-have, and I prefer Eclipse's way of providing it, because like Blakey, I don't feel the need to use ancient commandline apps for my text editing.


  • Discourse touched me in a no-no place

    @Magus said:

    All you need for Lisp is an editor that handles formatting right and a REPL.

    And all you need to survive is food and shelter, but most of us don't live in tents in the woods. Have you even tried emacs/slime?



  • no, but you haven't made any argument, except that I'm missing out on the greatest deal of a lifetime and should act now before I miss out. Sorry, but that isn't going to work. What features am I getting?


  • Discourse touched me in a no-no place

    @Magus said:

    like Blakey, I don't feel the need to use ancient commandline apps for my text editing.

    Yet you first mentioned Slackware as one of the distros you wanted to try.

    @Magus said:

    no, but you haven't made any argument, except that I'm missing out on the greatest deal of a lifetime and should act now before I miss out. Sorry, but that isn't going to work. What features am I getting?



  • So, I clicked the first video that search results in. It gave me things I get in Eclipse with Dandelion. You apparently think there's more. Feel free to tell me some of it.


  • Discourse touched me in a no-no place

    You can use whatever Lisp implementation you want, for starters. Also, there's a long track record of people actually using it without the issues you've mentioned. But everything I've read here so far indicates that your objections to Emacs are more ideological than anything else, so I'm muting the thread.



  • @antiquarian said:

    But everything I've read here so far indicates that your objections to Emacs are more ideological than anything else, so I'm muting the thread.

    I told you that from the start. Why do you have a problem with that? Why did you keep suggesting it, when I said no and had other working options?

    If I ask questions, I really like to get answers. Not "You should do it this way because everyone else does." When I ask what advantage that would give me it's less than useless to get "Look it up yourself." I'm not going to use something without evidence that it will help me, if a barrier to entry as large as that of Emacs' exists.

    Seriously, all I wanted out of this thread was things that might help me, not "Go use Emacs, everything will make sense because magic. Also don't use Lisp you idiot."

    Simple things would be nice, like: How is a Lisp program normally structured? What are some good Lisp versions I could try? How about Scheme? Anyone have a list of editors that work well, so I can choose one that fits my needs?

    I really don't care if you don't like Lisp, or love Emacs. Knowing those will not help me in any way.


  • area_pol

    For editor maybe Sublime? It has a Lisp syntax highlighter and some plugin for Lisp indentation. I do not know if it is any good (because I have no idea about Lisp), but Sublime often works well.

    About versions of Lisp: it is generally a good practice not to rely on implementation-specific features, so maybe use just the features from the language specs and it should work in any interpreter. (If there is no spec and every implementation does whatever it wants, I am afraid there is no good solution)



  • I hadn't considered Sublime, but it's definitely worth considering. I'll look into that after work. I doubt it'll handle the REPL well, but I can probably deal with an external one if it's easier to deal with.

    @Adynathos said:

    About versions of Lisp: it is generally a good practice not to rely on implementation-specific features, so maybe use just the features from the language specs and it should work in any interpreter. (If there is no spec and every implementation does whatever it wants, I am afraid there is no good solution)

    I agree. The main thing I care about when choosing a version is where I can use it. That's one of the reasons I'm using Clisp currently: It's everywhere. I'd happily move to scheme, but I don't know much about it's versions. There was a Chicken package that I downloaded that says it's portable, but I haven't looked deeply.


  • sockdevs

    There appears to be quite a few implementations of Scheme around



  • I haven't used it but there's a plugin called SublimeREPL that looks decent from the screenshots.



  • @hungrier said:

    I haven't used it but there's a plugin called SublimeREPL that looks decent from the screenshots.

    Definitely worth looking into. Thanks!

    @RaceProUK said:

    There appears to be quite a few implementations of Scheme around

    Ah, that's rather nice. I was looking through Wikipedia's just now, and the only one I recognized was Racket, which is definitely worth considering. From that list, Sagittarius looks nice.

    Ypsilon seems cool too.



  • @antiquarian said:

    http://lmgtfy.com/?q=emacs+slime+demo

    I don't think that qualifies for a LMGTFY link. If you are trying to make a case for something, you can't tell the person, when they ask you to argue your case, to look up the evidence for themselves and make your case for you.



  • There are plenty of people who believe that the mere sight of Emacs will change the heart of the unbeliever. I fully acknowledge that it's a great editor, and I enjoyed reading a bit about it's architecture, but I really just don't feel like it's for me.



  • @Magus said:

    Simple things would be nice, like: How is a Lisp program normally structured?

    If you really don't know much about LISP, I would recommend Structure and Interpretation of Computer Programs. It uses scheme but you should be able to translate to whatever dialect you're actually using. You can probably blast through the first few chapters before it starts getting into interesting stuff about the language.



  • @Magus said:

    I doubt it'll handle the REPL well, but I can probably deal with an external one if it's easier to deal with.

    I would (and I did) just go with the command prompt on the left side of the screen, text editor on the right side of the screen approach. It's simple, but it's all you need at first. You don't need a 1000-function graphing calculator to start learning arithmetic.

    I've seen too many people try to start projects and get bogged down in these kind of decisions and don't get anywhere.


    (just sharing my experience)

    My first lisp-like experience was with Clojure, editing in Sublime on Windows and running Leiningen commands in a command prompt.

    • I already had Windows running
    • I was already using Sublime
    • I already had Java installed
    • I already had the command prompt, of course
    • Leiningen can be downloaded as a single .bat file which will download clojure core and other packages automatically and a REPL can be opened immediately

    A relevant language on a relevant platform using relevant tools. And it has gotten some positive notice on my resume.



  • I went through the videos a while ago. They're fantastic.



  • @Magus said:

    I fully acknowledge that it's a great editor

    Absolutely. However, when I edit text, I want to edit text, not learn how to use an editor/IDE/shell/kitchen sink that is entirely unlike anything I already know before I can do so.

    @Magus said:

    the mere sight of Emacs will change the heart of the unbeliever
    Um, no.



  • Exactly.

    @Bort said:

    I went through the videos a while ago. They're fantastic.

    Oh, a video version! I've looked through the first couple chapters of the book before, and like their approach. I started reading some other guide recently, which was rather old and made a rather hilarious observation: There is at least one mass-market product written in Lisp: Microsoft Bob.

    http://psg.com/~dlamkins/sl/chapter01.html

    I also went through some random school's intro to lisp page, which refreshed me on the basics.

    My only problem with SICP and, in fact, Clojure, is that I really want to get some of the metaprogramming part, and as far as I know, macros are hardly mentioned in SICP.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.