Arc Forumnew | comments | leaders | submit | malisper's commentslogin
6 points by malisper 2501 days ago | link | parent | on: How many people still lurk here?

I check if there is anything interesting here once every few days.

-----

5 points by malisper 2699 days ago | link | parent | on: [Beginner question] New concepts in Arc

I don't think there is any one particular feature that is groundbreaking in Arc, although as a whole, Arc does have some interesting qualities. For example, code in Arc is much more succinct than code in other languages. When designing Arc, Graham would write a piece of code. He would then look at that piece of code and figure out what features would allow him to make that piece of code shorter. From there, he would implement that feature and rewrite the code. Due to this process, Arc has a large number of very simple utilities (e.g. check). With all of these utilities, code in Arc is much more concise than the equivalent code in other languages.

-----

5 points by malisper 2699 days ago | link | parent | on: [Beginner question] New concepts in Arc

"Hundred Year Language" is a bit of misnomer. Graham's original essay is a thought experiment on what the language we will be using in a hundred years will look like. Graham believed it would be useful to try and implement the language we will be using in a hundred years and in doing so, came up with Arc.

-----


I haven't seen anything like that, but it should be pretty easy for someone to create such an image.

-----

4 points by fauria 2695 days ago | link

I'm currently working on it. It's not being that easy though: https://github.com/arclanguage/anarki/issues/59

-----

5 points by akkartik 2690 days ago | link

I just want to point out a conversation I had with fauria on GitHub, in case others here have ideas. Currently the HN code doesn't support keeping the HN data (.../anarki/www) on a separate partition from the code (.../anarki) as Docker would like to do to maintain stateless containers. This is because any file creation which performs a create-then-rename first creates the temporary file in .../anarki/tmp. Renames then fail if .../anarki/www is in a different volume.

I'm not sure what the cleanest fix is here.

https://github.com/arclanguage/anarki/issues/59#issuecomment...

-----

4 points by malisper 2757 days ago | link | parent | on: Errors in anarki stable

That looks like [this](http://arclanguage.org/item?id=17699) which should have been fixed back then.

-----

3 points by akkartik 2757 days ago | link

Many thanks! I'll merge it to stable.

Edit: Done.

-----

2 points by Oscar-Belletti 2753 days ago | link

I checked now, string mutation works.

But what about the other warnings? Is the "main: not defined" warning due to my racket version?

The second warning (./arc.sh: line 40: [: too many arguments) disappears if I change (in arc.sh):

    if [ $repl = '#t' ]
To:

    if [ "$repl" = '#t' ]

-----

2 points by akkartik 2753 days ago | link

Yes, I wondered what to do about that and who if anyone cared about all those features. Then I forgot :/ I'll create a more bare-bones but working script today.

Edit 14 minutes later: Done: https://github.com/arclanguage/anarki/commit/8764126812. Do let us know if you have any other problems. (I've only tested the script on Mac at the moment.)

-----

2 points by Oscar-Belletti 2753 days ago | link

Now from the command line I don't get any warnings.

However, running arc in emacs (I use arc.el and arc-inferior.el) gives an error:

    rlwrap: error: My terminal reports width=0 (is it emacs?)  I can't handle this, sorry!
rlwrap doesn't work in emacs and this IMO is the reason the previous script had the --no-rl option.

-----

2 points by akkartik 2752 days ago | link

Ah, I see. Ok, I'll bring that back.

Thanks for explaining the reason for that flag.

Edit 15 minutes later: I've made the flag to disable rlwrap '-n' like in the master branch.

(I didn't pick the original flag, so I'm not attached to that name. I can change it if you want, I just want both branches to be consistent. I also renamed the script to 'arc' like in the master branch, just to make my life easier. I'll update the instructions at https://arclanguage.github.io next.)

-----

2 points by Oscar-Belletti 2752 days ago | link

Now it works both from the command line and from emacs.

It's ok for me that the the flag is -n.

I think that the arc script was named "arc.sh" because the folder which is used by the news server is "arc", and it would conflict. We can either take back the "arc.sh" name or change the news server's directory to something else, perhaps "www" like in the master branch.

Edit: We should also change the flag of the default program name in inferior-arc.el (line 95):

    (defvar arc-program-name "arc --no-rl"
To:

    (defvar arc-program-name "arc -n"

-----

2 points by akkartik 2752 days ago | link

Thanks for those comments!

Yeah you're right. I'm going to switch to arc.sh everywhere.

Edit 15 minutes later: all done, though the commit histories are a mess. Let me know if I missed renaming the script in any places!

-----

2 points by Oscar-Belletti 2750 days ago | link

"Thanks for those comments!"

You're welcome.

I'll certainly tell you if I find some references to the old "arc" name.

-----


I implemented most of Arc in Common Lisp[0]. It supports destructuring in def/mac, ssyntax through symbol-macrolet/macrolet[1], and the bracket lambda syntax through reader macros. IIRC the only real Arc feature it doesn't have is ccc (call-with-current-continuation) which is kind of supplied through the cl-cont library.

[0] https://github.com/malisper/Clamp

[1] http://letoverlambda.com/index.cl/guest/chap5.html#sec_4

-----

4 points by akkartik 2828 days ago | link

malisper, I've told you before about my troubles building Clamp[1], and I haven't learned anything new in the interim. Everytime I try to do anything with asdf I just feel stupid. Including a reference to http://common-lisp.net/project/asdf/asdf/Quick-start-summary... in your Readme[2] is not nearly enough. Could you describe, just for your own system:

a) what version of asdf (and sbcl and OS and processor...) you have tried and seen it working on,

b) which directory you put Clamp in when you clone it,

c) which directory you run sbcl from, and

d) what commands you use to load clamp after starting sbcl?

It would only take a few sentences/minutes, and it'll help immeasurably to get people unfamiliar with Common Lisp started with Clamp. Telling people how to get up and running (without needing to understand the dependencies you rely on) is the bare minimum prerequisite necessary to contemplate replacing Arc-on-Racket with Clamp-on-Common-Lisp.

It seems not a month passes without some new project I would find most interesting to try out, except it doesn't have a Readme, or it has a Readme with tons of prose except for the one primary thing I care about in the beginning: what are the precise concrete commands that have been known to have it do something, at least on some one computer? It's a super easy way to stand out among the crowd, and it only takes a few sentences compared to the thousands of lines of code you've already written.

[1] http://www.arclanguage.org/item?id=18895

[2] http://www.arclanguage.org/item?id=18894

-----

3 points by malisper 2827 days ago | link

You should only need Clamp to be in ~/common-lisp, and asdf >3.1.2. With that everything else should take care of itself. I think, but I'm not sure, that you can install the latest version of asdf through Quicklisp.

If you want the particular details, I am running sbcl 1.2.11 on Ubuntu 14.04 with Clamp in ~/common-lisp and asdf version 3.1.3. To load Clamp, after using 'M-x Slime' in Emacs to start Slime, I type '(require :clamp)' or '(require :clamp-experimental)' to load it.

-----

1 point by akkartik 2826 days ago | link

Still no luck, sorry. I'm on Ubuntu 14.04 as well, and I'm running sbcl 1.1.14.debian. I did the following:

  $ sudo apt-get install emacs
  $ emacs --version
  GNU Emacs 24.3.1

  $ cat .emacs
  ; from http://melpa.org/#/getting-started
  (require 'package) ;; You might already have this line
  (add-to-list 'package-archives
               '("melpa" . "https://melpa.org/packages/"))
  (when (< emacs-major-version 24)
    ;; For important compatibility libraries like cl-lib
    (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
  (package-initialize) ;; You might already have this line

  ; from https://www.common-lisp.net/project/slime/doc/html/Installation.html
  (setq inferior-lisp-program "/usr/bin/sbcl")

  $ pwd
  /home/akkartik
  $ ls common-lisp
  Clamp/

  $ emacs
  M-x package-install RET slime RET
  # some errors
  M-x slime
  # seemed to work
  * (require :clamp)
  Don't know how to REQUIRE CLAMP.
     [Condition of type SB-INT:EXTENSION-FAILURE]
I think I might be missing some step in between that you implicitly have..

-----

3 points by malisper 2826 days ago | link

What asdf version are you running?

-----

1 point by akkartik 2826 days ago | link

Ah yes, I meant to ask: how would I answer that?

-----

3 points by malisper 2826 days ago | link

(asdf:asdf-version)

-----

2 points by akkartik 2826 days ago | link

3.0.3

-----

3 points by malisper 2826 days ago | link

That's why you have been having issues. All you need to do is download a more recent version and load it in your .sbclrc file.

-----

4 points by akkartik 2826 days ago | link

Interesting! This is precisely what you need to record in the Readme!! "You need asdf 3.1 or higher." I assume you mean 3.1, right? According to http://www.cliki.net/ASDF the current version is 3.1. Is that really such a big difference?

I didn't think this was a problem since https://common-lisp.net/project/asdf/#downloads suggested just using the version that comes with my CL. Should I upgrade my sbcl as well?

Everytime I consider installing asdf manually I'm stymied by that last link. It provides an asdf.lisp but doesn't say what to do with it. Do I just load it? I just tried that without luck. I also tried various incantations from these tabs I have open: https://www.common-lisp.net/project/asdf-install/tutorial/in...; https://www.common-lisp.net/project/asdf-install/tutorial/se....

Common Lisp's crap documentation is culturally recursively turtles all the way down, just like all the good things about it.. :/ This is why I'm rooting for you to break out of this cycle of suck and improve things. Would you consider starting with a pristine Ubuntu 14.04 without sbcl or anything on it, and saving all the commands you type in until you get to a working Clamp? That would be wonderful to include in the Readme.

Another option might be to eschew asdf since the default versions on the most common Ubuntu release interact so poorly. Just dump all notion of dependencies and directly include all the code you need in the appropriate relative paths. Give me a single "sbcl --load" command to rule them all, just like Arc 3.1's classic "racket -f as.scm".

(It's not just Common Lisp, by the way. I have yet to meet a language-specific package manager that didn't suck. Pip, RubyGems, CPAN, it's all utter garbage. NPM hasn't started to suck yet, but I'm constantly looking for signs of incipient over-complexification.)

Edit: I'd be happy to provide a temporary Ubuntu server on Linode or something for this work.

-----

3 points by malisper 2825 days ago | link

> Is that really such a big difference?

No. It's just that asdf >=3.1.2 will check the ~/common-lisp directory by default. Prior to 3.1.2, you had to manually specify the directories you wanted asdf to check.

> https://common-lisp.net/project/asdf/#downloads suggested just using the version that comes with my CL. Should I upgrade my sbcl as well?

It looks like the version of sbcl you are using is old enough that the asdf version it comes with is older than 3.1.2. From that link, there is https://common-lisp.net/project/asdf/asdf.lisp Copy paste that into a file and add `(load "/foo/bar/asdf.lisp")` to your .sbclrc. I believe that Quicklisp comes with a more recent version of asdf, so you can also try setting that up and seeing if that configures asdf properly.

> I also tried various incantations from these tabs I have open

Those are for asdf-install which IS NOT asdf: http://www.cliki.net/asdf-install

asdf-install was the previous version of Quicklisp, but you should now be using Quicklisp instead.

I should spend the time to make Clamp a Quicklisp package so that you would be able to install it with just `(ql:quickload :clamp)` instead of needing to deal with asdf.

-----

1 point by akkartik 2825 days ago | link

That would be great, thanks.

> Those are for asdf-install which IS NOT asdf: http://www.cliki.net/asdf-install

O_O

-----

1 point by akkartik 2824 days ago | link

Ah, I FINALLY managed to get Clamp loaded. Here are the steps I followed from my home directory on Ubuntu 14.04:

  $ sudo apt-get install sbcl
  $ wget https://beta.quicklisp.org/quicklisp.lisp  # following instructions at https://quicklisp.org
  $ sbcl --load quicklisp.lisp
  * (quicklisp-quickstart:install)
  * (ql:add-to-init-file)
  * (quit)
  $ cd quicklisp/local-projects
  $ git clone https://github.com/malisper/Clamp
Now, from any directory:

  $ sbcl
  * (ql:quickload :clamp)
  * (in-package :clamp)
  * (use-syntax :clamp)
Now it's ready!

  * (map [+ _ 1] '(1 2 3))
  (2 3 4)
Woohoo! I'll send you a pull request. Is there some way we can provide an "Arc repl" that's already in the right package and uses the right syntax? I tried this, but it didn't work:

  $ cat quicklisp/local-projects/Clamp/init.lisp
  (ql:quickload :clamp)
  (in-package :clamp)
  (use-syntax :clamp)
  $ sbcl --load quicklisp/local-projects/Clamp/init.lisp
  ; Loading "clamp"
  * (map [+ _ 1] '(1 2 3))
  The variable [+ is unbound.

-----

3 points by malisper 2824 days ago | link

Reader macros work on a per file basis so I don't think there is a way to set the proper syntax from a separate file.

You might want to consider trying to setup Slime, as it provides some really amazing Smalltalk-esque features. I detailed most of them in my blog series, Debugging Lisp[0]. Some of the ones I covered in the post are: recompilation of code at runtime, restarting of a stack frame at runtime, an object inspector, interactive restarts (restarts are a better form of try/catch), various forms of function lookup (e.g. list all functions who call function X). I haven't yet covered it, but I eventually want to, is slime-macrostep[1]. It lets you interactively expand parts of a macro step by step.

[0] http://malisper.me/2015/07/07/debugging-lisp-part-1-recompil...

[1] http://kvardek-du.kerno.org/2016/02/slime-macrostep.html

-----

1 point by akkartik 2822 days ago | link

I'm trying to work through http://malisper.me/2015/07/07/debugging-lisp-part-1-recompil... but I got this error when I tried to restart from any of the stack frames:

  Cannot restart frame: #<SB-DI::COMPILED-FRAME EVAL>

-----

1 point by akkartik 2823 days ago | link

Ah, I figured out a way to run it with just:

  $ clamp
https://github.com/malisper/Clamp/pull/5

-----

1 point by akkartik 2824 days ago | link

Yes, I'll certainly try to add Slime back now that I have the foundation working well together.

-----

1 point by akkartik 2822 days ago | link

I've gotten Slime working, but so far I'm still doing the same things I would do in an interactive session:

  $ emacs
  M-x slime RET
  # in the slime buffer
  * (ql:quickload :clamp)
  * (in-package :clamp)
  * (use-syntax :clamp)
Is that what do you typically do?

Also, when I try to C-x C-e an arc expression in some random buffer after the above steps, it doesn't seem to remember the above commands anymore. The only thing that works is running commands at the repl.

-----

4 points by malisper 2822 days ago | link

> I've gotten Slime working, but so far I'm still doing the same things I would do in an interactive session:

Yes, that's what I typically do. If you wanted to, you could add those instructions to your .sbclrc, and that should load Clamp on start up.

> Also, when I try to C-x C-e an arc expression in some random buffer after the above steps, it doesn't seem to remember the above commands anymore.

You need to have slime-mode enable in the buffer you are editing. You can add the following code to your .emacs:

    (require 'slime)
    (add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
and then whenever you open a file that ends in .lisp, it will enable slime-mode.

If you are going to get into programming Lisp with Emacs, you should look into Evil (vim bindings for Emacs), paredit (smart paren editing), ac-slime (autocomplete for slime), show-paren-mode (shows matching parens), and undo-tree (a better version of undo/redo). Although I've never used it, you might want to look at Spacemacs which is supposed to supply sane defaults for Emacs.

-----

3 points by zck 2821 days ago | link

>If you are going to get into programming Lisp with Emacs, you should look into Evil (vim bindings for Emacs), paredit (smart paren editing), ac-slime (autocomplete for slime), show-paren-mode (shows matching parens), and undo-tree (a better version of undo/redo).

Yes, customizing Emacs is really useful for making it better to use. To help with that, here are some of my config's settings for things you've mentioned. My show-paren-mode settings are here (https://bitbucket.org/zck/.emacs.d/src/default/init.el?filev...).

Instead of paredit, I use smartparens. They do similar things, but when I looked at the two, I thought smartparens was better, although I can't remember why right now. My config is here (https://bitbucket.org/zck/.emacs.d/src/default/init.el?filev...).

I should similarly check out the other things you've mentioned (except Evil, 'cause I don't like modal editing).

-----

1 point by akkartik 2822 days ago | link

Ah, that hook was what I needed. Thanks! I'll check out all your tips.

-----

1 point by akkartik 2824 days ago | link

Draft changes to Readme: https://github.com/malisper/Clamp/pull/3/commits/d4e89140b9

Everyone please try out the instructions and/or suggest improvements to the prose.

-----

2 points by highCs 2827 days ago | link

> replacing Arc-on-Racket with Clamp-on-Common-Lisp

We need a compiler for that btw (ie. the arc macro Im talking about nearby?) because 1) language designers need a compiler and 2) right now, it is missing parts of Arc; specifically:

  ('(1 2 3) 0)
  (mylist 0)
  ("Yoopi" 0)
  (+ "Hello" " World")
  top level ssyntax
  What case are missing for destructuring?
  What am I forgetting? Do we have 'for'?

-----

2 points by highCs 2827 days ago | link

Put clamp inside quicklisp/local-projects/

Run your lisp wherever you want and then:

  (asdf:load-system :clamp)
  (defpackage #:mypkg (:use clamp))
  (in-package #:mypkg)
(tested with ccl)

> Telling people how to get up and running

Second that. Some intructions in the README to get clamp up and running on linux would be a must. OSX and windows would be nice to have too.

-----

3 points by akkartik 2827 days ago | link

Doesn't work with sbcl, I'll try it with ccl later today:

  $ uname -a
  Linux akkartik 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux

  $ pwd
  /home/akkartik

  $ sbcl --version
  SBCL 1.1.14.debian

  $ ls quicklisp/local-projects
  Clamp/  system-index.txt

  $ rlwrap sbcl
  This is SBCL 1.1.14.debian, an implementation of ANSI Common Lisp.
  More information about SBCL is available at <http://www.sbcl.org/>.

  SBCL is free software, provided as is, with absolutely no warranty.
  It is mostly in the public domain; some portions are provided under
  BSD-style licenses.  See the CREDITS and COPYING files in the
  distribution for more information.
  * (require :asdf)

  ("ASDF")
  * (asdf:load-system :clamp)

  debugger invoked on a ASDF/FIND-SYSTEM:MISSING-COMPONENT in thread
  #<THREAD "main thread" RUNNING {ABFC8D1}>:
    Component :CLAMP not found

  Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

  restarts (invokable by number or by possibly-abbreviated name):
    0: [ABORT] Exit debugger, returning to top level.

  ((:METHOD ASDF/OPERATE:OPERATE (SYMBOL T)) ASDF/LISP-ACTION:LOAD-OP :CLAMP) [fast-method]
  0]
  *
Oh, are you using it with Quicklisp? I also tried installing quicklisp as well, but it didn't change the error.

-----

2 points by highCs 2827 days ago | link

I didnt installed clamp using quicklisp which wasnt able to find it. I put clamp myself in the local-projects folder.

I think ccl has an asdf thing and must be at the origin of the quicklisp folder look up. I hoped it was standard.

-----

1 point by akkartik 2827 days ago | link

But you have quicklisp installed with ccl? That's why CCL looks in quicklisp/local-projects?

-----

1 point by akkartik 2827 days ago | link

Hey, is CCL not open-source?

-----

2 points by highCs 2827 days ago | link

It's even free buddy: http://ccl.clozure.com/

-----

1 point by akkartik 2827 days ago | link

Ah, I got confused because the svn repo came with a prebuilt binary. But it has the sources too.

-----

3 points by highCs 2830 days ago | link

Clamp seems perfect. It's beautiful. It's clean. It's amazing.

I think we should evaluate if the Arc community want to switch to clamp as a main implementation (it's ok, we can take our time..). I gonna use it this week end to see if I find any problem.

-----

4 points by akkartik 2830 days ago | link

Looking forward to seeing you take the lead on this!

-----

3 points by highCs 2830 days ago | link

Okay :)

Just made a quick test on my pet project using :clamp (not clamp experimental) and since most CL is exported, it's pretty compatible and works without much effort. So far so good. I'm gonna test the experimental part this week end.

-----

4 points by malisper 2830 days ago | link

I did find a better way to export everything. By using defpackage-plus, you can define a package definition clause that imports and exports every symbol that doesn't have a naming conflict with the current package. Exporting all of the symbols in :cl becomes just using this clause on :cl.

-----

3 points by highCs 2829 days ago | link

Nice. You made ('(1 2 3) 0) working? Or its only working when using ssyntax (ie array.0)?

-----

4 points by malisper 2829 days ago | link

That's only ssyntax. a.b is rewritten as (get a b) where get is a generic function. You may be able to use set-funcallable-instance-function to get something closer to what arc supplies. Also there are a lot of edge cases with the ssyntax since you have to be within a w/ssyntax block. There is one included in def, so you can use ssyntax in function definitions, but you can't use it at the toplevel.

-----

2 points by highCs 2828 days ago | link

An idea would be to have an arc macro that compile arc code.

  (arc :l "myprogram.arc")
  (arc :e (f:g 3.14))

-----

2 points by akkartik 2829 days ago | link

Interesting. I think Wart supported ssyntax at the toplevel.

-----

2 points by akkartik 2828 days ago | link

Yup:

  $ git clone https://github.com/akkartik/wart
  $ cd wart
  $ git checkout sbcl
  $ ./wart
  wart> car.nil
  nil

-----

1 point by highCs 2827 days ago | link

Gonna have to take a closer look at wart.

-----

2 points by akkartik 2827 days ago | link

I wouldn't spend too much time on it. malisper truly has the right idiomatic approach with packages. I was mostly just flailing around with the little bit of Common Lisp I understand.

-----

3 points by highCs 2830 days ago | link

I've not dive into it but I actually like a lot the idea of Arc being implemented as macros into CL. Ill take some time to review this implementation I think (at least for myself :P).

EDIT: clamp looks awesome.

-----

1 point by highCs 2830 days ago | link

I recommend the community to audit this implementation and to switch to it as a primary impl if it's any decent. Every link should be redirected to it. I can say quite confidently that CL is the best lisp out there today and the way to go forward as the other lisp dialects both sux and are stucked (even clojure; I've made a 5K+ LOC program with clojure and got tons of technical problems as the codebase got bigger).

-----

1 point by akkartik 2830 days ago | link

Ah, yes I knew I was missing something more recent: http://www.arclanguage.org/item?id=18889

-----


I just want to start off by saying that you may want to show your professor Clamp[0]. It is a project I have been working on and my goal is to implement as many features from Arc as possible in Common Lisp. Most of the references are to code for Clamp.

Differences between Arc and Common Lisp.

Lisp-1 vs Lisp-2: Arc is what's know as a Lisp-1. That means that procedures are really just procedure objects stored in regular variables (ie "len" is just a variable in Arc, whose value is a procedure that can calculate the length of a sequence). Common Lisp on the other hand is a Lisp-2. This means that it is possible to have a procedure "len" (which can calculate the length of a sequence), and a variable "len" (which may be the length of a particular sequence), without any conflicts even though they are both named "len". Some people prefer a Lisp-1 because it makes code simpler and shorter (you never have to use something analogous to Common Lisp's funcall), and some people prefer a Lisp-2 because then don't have to deal with conflicts between procedures and variables having the same name.

Special Syntax: Arc provides a special kind of syntax called ssyntax, short for special syntax. Each ssyntax provides a shorter way for writing a common pattern. For example a&b is short for (andf a b), a:b is short for (compose a b), a.b is short for (a b), and a!b is short for (a 'b). The last two are extremely useful for accessing into data structures which I explain more in the next section. I just want to point out that it is possible to write a version of ssyntax in Common Lisp[1][2][3]. There are some issues that come up because Common Lisp is a Lisp-2.

Data Structure Access: In Arc, you can use data structures as procedures. Calling a list with an argument will get that place in the list [ie (x 5) will get the element at index 5 in x.]. Note that this is why the shorthand a.b and a!b are so useful. Anarki takes things a step further by allowing a programmer to define how to coerce types to other types and therefore allows one how to define what happens when you call an arbitrary object as a procedure. Common Lisp provides nothing like any of this.

Procedure Arguments: There are some differences in how procedures are defined and called between Common Lisp and Arc. Arc provides an easy way to destructure and argument. For example it is possible to a procedure to get the first element of a list as just (def car ((a . b)) a). It is possible to implement this feature in Common Lisp[4][5]. There are some slight differences with syntax to define a procedure that has optional arguments or rest arguments. Another difference between the two is that Common Lisp provides something called "keyword arguments". Keyword arguments provide a way of having arbitrary ordered optional arguments. For example I wrote a procedure "group"[6], which does roughly the same thing as both pair and tuple in Arc. There are some versions of Arc that provide keyword arguments (Anarki is not one of them).

Reader Macros: Arc provides a shorthand for lambda functions of one argument (Anarki has extended this feature to provide any number of arguments). It is possible to write [+ _ 5] instead of writing out (fn (_) (+ _ 5)). Common Lisp provides something much more general called "reader macros". Reader macros allow a programmer to design new syntax. While I won't go in depth about reader macros, they allow a programmer to create new syntax within Common Lisp. Using brackets as a shorthand for lambda functions is possible to implement with reader macros.

Module System: Most versions of Arc do not provide a module system.

Debugger: One of the most important differences between the two is Arc's lack of a debugger. AFAIK, the only way to debug Arc code is to include print statements throughout your code (using print statements is actually a really effective way to debug code), and there are ways of creating more advanced debugging techniques through the use of macros. Common Lisp provides a full debugger along with something called "restarts"[7]. The Common Lisp restart system is extremely useful, although it should be possible to implement something similar in Arc.

IDE: Arc does not have any sort of IDE, whereas Common Lisp has Emacs/Slime. I wrote about some of the features Slime provides here[8].

[0] https://github.com/malisper/Clamp

[1] https://github.com/malisper/Clamp/blob/master/tests/ssyntax-...

[2] https://github.com/malisper/Clamp/blob/master/experimental/s...

[3] https://github.com/malisper/Clamp/blob/master/experimental/s...

[4] https://github.com/malisper/Clamp/blob/master/tests/destruct...

[5] https://github.com/malisper/Clamp/blob/master/experimental/d...

[6] https://github.com/malisper/Clamp/blob/master/src/list.lisp

[7] http://en.wikibooks.org/wiki/Common_Lisp/Advanced_topics/Con...

[8] https://news.ycombinator.com/item?id=8474161

-----

2 points by maxdeviant 3411 days ago | link

Thank you for your very thorough reply!

This is exactly the kind of information I have been looking for and that I think he would be interested in.

Clamp sounds very interesting as well, especially since we just covered macros in class last week.

-----


Thank you. I would say the things to note would be defalias, ssyntax (in experimental), and how I used packages to redefine the standard procedures.

-----


It looks like we took two completely different approaches. You implemented a wart->CL compiler (wt-transform), while I just wrote all of the Arc utilities in Common Lisp and shadowed some built in procedures/macros.

Your approach probably winds (wound?) up being much more flexible in the long run.

-----

3 points by akkartik 3490 days ago | link

No, it's not a full compiler. It's different in a crucial respect: things it doesn't understand get passed straight out. This allows me to do most things as macros, just like you. More information: http://arclanguage.org/item?id=12814

I haven't dug into it yet, but I suspect the crucial difference might be your use of packages, which is more in line with Common Lisp idioms.

-----

2 points by akkartik 3489 days ago | link

Remind me, how does one install an asd package? :) Might be worth including in the Readme.

-----

2 points by malisper 3489 days ago | link

All you need is asdf 3.1.2 or later and Clamp has to be somewhere in your ~/common-lisp/ directory. Once you do that, just use (require :asdf) and (require :clamp).

I'll just include a reference to this[0] in the readme.

[0] http://common-lisp.net/project/asdf/asdf/Quick-start-summary...

-----

1 point by akkartik 3489 days ago | link

I get this error when running from the Clamp directory:

  $ sbcl
  * (require :asdf)
  NIL
  * (require :clamp)
  ASDF could not load clamp because
  Error while trying to load definition for system clamp from pathname
  ~/Clamp/clamp.asd:
     The name "ASDF-USER" does not designate any package..

  debugger invoked on a LOAD-SYSTEM-DEFINITION-ERROR in thread
  #<THREAD "initial thread" RUNNING {1002998F33}>:
    Error while trying to load definition for system clamp from pathname
    ~/Clamp/clamp.asd:
       The name "ASDF-USER" does not designate any package.

  Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

  restarts (invokable by number or by possibly-abbreviated name):
    0: [RETRY                                 ] Retry EVAL of current toplevel form.
    1: [CONTINUE                              ] Ignore error and continue loading file "~/Clamp/clamp.asd".
    2: [ABORT                                 ] Abort loading file "~/Clamp/clamp.asd".
    3: [REINITIALIZE-SOURCE-REGISTRY-AND-RETRY] Retry finding system clamp after
                                                reinitializing the
                                                source-registry.
    4:                                          Exit debugger, returning to top
                                                level.

  ((FLET #:LAMBDA2286 :IN ASDF::LOAD-SYSDEF)
   #<SB-KERNEL:SIMPLE-PACKAGE-ERROR "The name ~S does not designate any package."
     {10049EB763}>)
  0]

-----

2 points by malisper 3489 days ago | link

I'm not sure but you might want to check your .sbclrc file for anything weird and make sure you have the latest version of asdf.

Other than that, the only thing I can suggest is opening a question on Stack Overflow.

-----


There is more about it on the wikipedia page: http://en.wikipedia.org/wiki/CGOL

-----

1 point by akkartik 3548 days ago | link

Interesting to compare it to http://readable.sourceforge.net and my http://akkartik.name/post/wart.

-----

More