Arc Forumnew | comments | leaders | submit | thaddeus's commentslogin

Lua looks good to me. I was trying to see the performance benchmark from the shootout link, but it's down. I'm pretty sure I put Lua along with python. Docs/libraries are great, but is on the slower side. Lua is on my list to learn :)

-----


I've started haskell. I chose haskell because it appears there is a good balance between performance/documentation/libraries. I already know one language that can be slow, so I think learning a language that's blazing fast will balance the mix. And although Python/Ruby have better docs/libraries - they are much slower than even scheme/arc. Erlang docs are horrific. IMHO.

-----

1 point by rocketnia 5758 days ago | link

You came to pretty much the same conclusions I did. I'll probably try out Haskell too. It fits nicely with the kind of side-effect-free-even-to-the-point-of-monads-and-arrows programming I try to do in other languages anyway, and the main thing keeping me away from it has been a perception that it had a really slow implementation.

What I had ended up voting for in the poll though was Clojure. I figure it's lenient about types, it's very reliably cross-platform ('cause of all the business interest in maintaining Java), it has better documentation than Erlang, it can still communicate with C and Erlang (as pretty much any language can, apparently), and beyond that, it has a language-level focus on communicating with other JVM code, which should give you good access to lots of other well-worked-on codebases. As far as I can tell, once you've got access to C and JVM libraries, Python libraries are the next gold mine, but I don't know how to access those libraries except through Python somehow (like through system calls or something), so it didn't affect my decision. (Incidentally, for many of the same reasons I recommend Clojure, I'm hooked on Groovy, but I did consciously try not to let my own criteria make a difference.)

In any case, yeah, now that I see it as fast, Haskell looks great. :-p

-----

1 point by thaddeus 5757 days ago | link

I wonder if it's possible to build the beautiful arc syntax as a layer upon haskell. Probably not doable ~ macro's/expansion and all, but still - would be awesome.

-----

1 point by rocketnia 5756 days ago | link

Liskell sounds very close to what you're thinking about. Also, the "Write Yourself a Scheme in 48 Hours" Haskell tutorial might interest you. I think this is a pretty popular train of thought. ^_^

That's actually where I'm starting with Haskell. It turns out Haskell is a much more natural home for Blade (my pet lisplike) than any of the other languages I've tried: JavaScript, Groovy, Arc, and Blade itself (with an intent to port/bootstrap it). It's almost scary!

-----

2 points by lg 5755 days ago | link

ruby is slower than arc? i'm curious what your benchmarks were...

-----

3 points by thaddeus 5754 days ago | link

Assuming arc is marginally slower than PLT scheme:

http://shootout.alioth.debian.org/u64/which-languages-are-fa...

  Scheme PLT	         1.14	1.14	7.65	13.61	20.05	38.65	62.92
  Smalltalk VisualWorks	13.79	13.79	17.46	19.56	27.98	43.78	65.61
  Lua	                 1.39	2.00	16.02	22.85	25.37	39.39	47.59
  Ruby JRuby	        11.30	11.30	16.85	28.99	70.01	149.76	199.57
  PHP	                 2.00	2.00	9.11	58.75	90.47	105.12	105.12
  Python CPython	 1.93	1.93	12.76	62.45	69.75	110.98	110.98
  Perl               	 2.01	2.01	7.28	67.28	107.69	192.28	192.28
  Ruby MRI	         7.44	7.44	28.42	91.00	195.87	447.05	535.97

-----

4 points by thaddeus 5758 days ago | link | parent | on: using MySQL with arc?

Thanks for the reply.

I ended up using dbslayer to interface with mysql. And along with aw's json combinator + stefano's? http-get/utils - it works brilliantly!

http://code.nytimes.com/projects/dbslayer

http://awwx.ws/combinator/

http://github.com/nex3/arc/tree/arc2.master/lib/http-get/

One note: I needed to change the dbslayer source code, prior to making the install, in order to eliminate the spaces that aw's combinator would choke on. It was a trivial change though...

[EDIT: Correction I was using an older version of aw's combinator - the new version handles spaces]

T.

-----

1 point by aw 5758 days ago | link

That's cool. It's a neat idea that by default (if there isn't an explicit reason why you have to do something else), all interfaces can be HTTP, and as a bonus use JSON as your data interchange format...

-----

1 point by thaddeus 5758 days ago | link

Exactly. The concept is great. Even now when I am starting to learn haskell, the first thing I am doing checking out haskells' JSON parser to communicate via HTTP. Conceptually I can keep doing this and communicate easily across any language. And since SQL to URL is so basic I can re-use/apply dbslayer to any language too.

-----

1 point by aw 5758 days ago | link

Aha, I knew I'd seen some post that talked about this, and I found it: http://timothyfitz.wordpress.com/2009/02/12/why-http/

-----

1 point by thaddeus 5758 days ago | link | parent | on: Scheme version of JSON

I was trying to read this thread and determine what came out of this... did it turn out that the scheme version was faster ? I'm curious.

thnx.

-----

1 point by aw 5758 days ago | link

What input did you give the parser that gave that error?

akkartik reports that the Scheme version is substantially faster. I have it working with the hackinator: http://arclanguage.org/item?id=10848

-----

1 point by thaddeus 5758 days ago | link

Sorry aw; I messed you up and edited my post after you replied....

see http://arclanguage.org/item?id=10942 - I fixed it on my own.

Here was the original case example:

  (fromjson "{\"RESULT\" : {\"SUCCESS\" : true} , \"SERVER\" : \"cool dude\"}")

-----

1 point by aw 5758 days ago | link

This is what I get:

  $ hack ycombinator.com/arc/arc3.1.tar awwx.ws/parsecomb0.arc awwx.ws/fromjson0.arc
  /tmp/4uG5ClxUqg
  ycombinator.com/arc/arc3.1.tar
  awwx.ws/parsecomb0.arc
  awwx.ws/fromjson0.arc
  mzscheme -f as.scm
  Use (quit) to quit, (tl) to return here after an interrupt.
  arc> (fromjson "{\"RESULT\" : {\"SUCCESS\" : true} , \"SERVER\" : \"cool dude\"}")
  #hash(("SERVER" . "cool dude") ("RESULT" . #hash(("SUCCESS" . t))))
  arc>
Are you possibly using an earlier version?

-----

1 point by thaddeus 5758 days ago | link

yup - sorry. I didn't update to the last version :)

-----


I'd imagine arc must be slower...

-----

4 points by akkartik 5759 days ago | link

Yep, way slower. Arc works only because of its escape valves. When I want to parse html I escape to python's beautiful soup and emit JSON. When I wanted a faster JSON parser I escaped to scheme. When I needed something to be still faster I escaped to C through scheme's FFI.

I haven't needed to call system yet :) (http://arclanguage.org/item?id=3522 via* http://arcfn.com/2009/08/arc-arduino-arm-temperature-monitor...)

-----

1 point by kens 5754 days ago | link

I assume you're using Anarki, because standard Arc doesn't have any of those escape valves other than system, which I find quite annoying.

-----

4 points by aw 5753 days ago | link

If you prefer not to have all the changes that Anarki makes to Arc, the http://awwx.ws/ac patch adds just the ability to drop into Scheme from Arc.

-----

2 points by akkartik 5752 days ago | link

And once you have $/ac-scheme, you can load libraries through scheme's FFI, or load scheme libraries say for parsing json.

I'm not using anarki, just pieces that I like.

(sorry, addressing grandparent)

-----


I would suggest stepping through pgs tutorial:

http://ycombinator.com/arc/tut.txt

Then ask questions along the way.

-----

1 point by crownoflaurel 5759 days ago | link

I've only gotten about a quarter through this, but I like what I've heard. Is there a place where I can experiment, aside from the one already mentioned?

-----

1 point by thaddeus 5759 days ago | link

As suggested by aw you should start by installing arc.

Arc is a layer built upon scheme, thus to use arc you also need mzscheme.

I normally start by downloading arc from here -> http://ycombinator.com/arc/arc3.1.tar

Unpack the 'tar' file and put it somewhere you're happy with.

Then get the latest version of MzScheme here -> http://download.plt-scheme.org/mzscheme/.

I generally take the scheme folder and put it inside the arc folder. This is not required, but earlier I found it easier to manage as they become one movable install.

Arc is best suited to unix/linux or mac operating systems. Arc has some issues on Windows, but In the past I still managed to get it working on windows.

If you're using a unix/linux or mac os you need to find the Terminal application that is already there and launch it.

In the terminal window you need to navigate to the arc directory. You can do this by typing 'cd' (change directory) followed by the path to the arc folder...

In my case:

  Terminal $ cd /users/thaddeus/arc
If all goes well, as a test, you should be able to type 'ls' which will show you the files existing in the arc directory.

  Terminal $ ls
  
now to you can invoke arc by typing (note change the paths to respect your install directories):

  Terminal $ /users/thaddeus/arc/scheme/bin/mzscheme -f as.scm 
which should provide an Arc prompt:

  arc>
Then you're off to the races.

Windows is similar only you're using the 'cmd' utility rather than the terminal.

You can start 'cmd' (command prompt) by going to your operating systems 'Start' button then select 'Run' and type 'cmd' into the text entry box (& hit 'ok'). A dialog window should come up. Here you also need to navigate to the arc directory:

Mine starts like this:

  C:\Documents and Settings\thaddeus>_
So I change the path to the arc directory like so (note change the paths to respect your install directories):

  C:\Documents and Settings\thaddeus> cd C:\thaddeus\arc
which changes the prompt to:

  C:\thaddeus\arc>
I then invoke arc like so:

  C:\thaddeus\arc> C:\thaddeus\arc\MzScheme\MzScheme.exe -f as.scm 
And you should get an arc prompt

  arc>
I typed all this up on my lunch hour at work, so I didn't actually do the steps - just memory recall. So if you hit a snag ask, I may have typed something wrong.

There's a few other resources for you:

1. Easy means to search the arc forum: http://af.searchyc.com/

2. Good documentation: http://arcfn.com/doc/index.html

-----

1 point by thaddeus 5754 days ago | link

If you're not tied to arc, a good online learning tool can be found for the Ruby language...

http://tryruby.sophrinix.com/

It's brilliant for day one programmers - Arc should really have something this nice.

-----


another great post by arcfn!

re: > "Arc requires the silly clearing of srvops*"

Why would ken need to clear this? I don't think this is required.

-----

4 points by kens 5760 days ago | link

I should have said:

"Arc requires the clearing of srvops* unless you want the webserver to respond to a dozen URLs in unexpected ways."

Specifically, the Arc web server automatically implements /login, /logout, /whoami, /admin, /mismatch, and various other things, unless you clear out srvops*. I don't know that any of these are security holes, but I'd rather disable them since I don't want them.

-----

1 point by thaddeus 5760 days ago | link

I see.

-----


I wouldn't worry about using this forum as a means to learn programming. I did. The member's have treated me very well even when some of my newbie questions hadn't made much sense.

The only unfortunate part is that many of the more senior members have left, but the few still kickin around are very helpful - so just keep posting your questions.

http://arclanguage.org/leaders

-----

1 point by jsgrahamus 5749 days ago | link

Why have the senior members left?

-----

2 points by aw 5748 days ago | link

pg had been writing about plans for Arc for several years, and so there was a big wave of interest when Arc was first released, and the forum was more active then. We've settled down for the long haul now :-)

Though, without disparaging forum contributions, I wouldn't necessarily equate leadership with the "leaders" list of people with high karma values. Many of the people who have made some of the most significant documentation and code contributions aren't at the top of the "leaders" list.

-----


You have the impression I plan to stop working with/on arc, which is not the case.

The whole point of the FFI is to interface with other languages and such... so I would then need to know the other languages to make further use of the FFI.

I don't know why I would want to write a packaging system, but assuming we're referring to the same kind of packaging... I probably wouldn't use arc when many well developed solutions in other languages already exist.

-----


As for goals/uses... really I just want options. Ideally in the future I can interface between arc and this/these languages. This way if arc is not a good fit for doing some thing then I can use another language to do that part.

-----

5 points by aw 5762 days ago | link

Work backwards.

First there's some thing that I want to do.

Then I look for libraries or API's that will do that thing for me.

If there are several options, I look for one which seems to be the most practical and straightforward implementation.

These days when I go through this process I most often end up with a library or API written for Perl, Python, Ruby, or Java.

What I would suggest is learning enough of each of these languages so that you can make library calls. Which is pretty easy to do; you don't need to learn a lot to do that.

Then how much you need to program in that language vs. Arc usually comes down to efficiency. Each call from Arc to the other language involves a round-trip of some sort; so if you're doing something in a loop then you'll often want to push the code to do that loop into the other language. So you may end learning more of the other language as you translate some parts of your Arc code into the other language.

-----

More