Arc Forumnew | comments | leaders | submitlogin
Poll: What language should I learn after Arc?
7 points by thaddeus 5502 days ago | 35 comments
As some of you probably know I started programming in Arc. While I still plan to code in Arc, I would like to get familiar with other languages as well. Since my day job is not anything related to coding I don't need to steer over to the the obvious c# or java choices for resume propping. The following list is just off the top of my head. As a note I'm not really the kind of person that wants to do the math to map data bytes to memory blocks or to the like. I'm interested in high level languages.
c#
0 points
java
0 points
ruby
0 points
erlang
4 points
clojure
3 points
python
5 points
perl
2 points
haskell
8 points
Lua
0 points
Factor
0 points
javascript
3 points


2 points by garnet7 5497 days ago | link

I'd probably look for something very different from Arc -- something at least partly complementary. However, I don't know what that would be. What language would at least somewhat complement Arc but not be a low-level language like C?

I wouldn't recommend Ruby because I was not happy with the state of their docs and it didn't seem different enough from Perl or Python to warrant a major effort.

I wouldn't recommend Perl, because Perl is mostly for getting stuff done. If you want to get things done, use Perl, but if you want to learn a language for the intellectual gratification of learning something new, Perl might not be the best for that.

Java is mostly a verbose Python, so I wouldn't recommend that either.

Python works well enough. Not terribly interesting, imo.

Erlang seems pretty heavily focused on concurrency, so unless you need that I probably wouldn't specifically recommend Erlang.

I've heard Lua is simple and tiny. That might be interesting.

Haskell looks difficult. :)

Smalltalk might complement Arc nicely. Maybe Smalltalk.

-----

2 points by thaddeus 5497 days ago | link

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 5496 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 5495 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 5495 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 5493 days ago | link

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

-----

3 points by thaddeus 5493 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

-----

5 points by revorad 5501 days ago | link

javascript because you can do fun internetty things with it.

-----

3 points by thaddeus 5501 days ago | link

Good point. Although I didn't stipulate this in my original post I kinda assumed no matter what language I pick I will have to continue increasing my js knowledge to continue building web apps. I already do already use js and jquery often.

-----

2 points by aw 5501 days ago | link

That's actually not a bad idea. Server side languages are fundamentally equivalent in the sense that what one can do another can do, though it may be easier or more fun in one language or another. Javascript lets you program the user interface in the browser. Check out http://jquery.com/ for a useful Javascript client-side library.

-----

1 point by rocketnia 5501 days ago | link

Well, there are a lot of good languages on your list. Just about the only one I don't feel like voting for is C#. :-p So do you have any more criteria/goals/uses to speak of that could narrow it down?

-----

1 point by thaddeus 5501 days ago | link

yup (and prioritized):

  * great documentation & write ups.
  * feature rich well supported libraries (i.e. database connections, vector graphics libraries etc..)
  * macOSX and Linux support.
  * active community of users at all levels. 
  * low overhead (I like that arc is a dynamic language, has type inference, and lexical scope)

-----

1 point by thaddeus 5501 days ago | link

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 5501 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.

-----

2 points by thaddeus 5496 days ago | link

Too bad the poll feature for this forum doesn't allow for everyone to submit 'choices'. :(

-----

2 points by adrianwaj 5501 days ago | link

There is a web dev house here in Israel that user RoR and Erlang together. That would be a dynamite combination (well that's what they claim.)

-----

2 points by lg 5499 days ago | link

i think powerset got rails running on yaws, i never checked that out though.

-----

1 point by Kz 5499 days ago | link

Lua: (almost) as minimalistic as Scheme while retaining most of its power, with a very nice syntax, really fast VM, and great community

-----

1 point by garnet7 5497 days ago | link

Just curious, what don't you like about Lua? (I think I read that they use 1-based (instead of 0-based) array indexing. That seems like it might be annoying.)

-----

1 point by garnet7 5496 days ago | link

Edit: Why can't I speak english? Of course I meant something more like, "Are there any features of Lua that you don't particularly care for?"

-----

1 point by thaddeus 5496 days ago | link

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 :)

-----

1 point by apogosian 5501 days ago | link

Why not start working on Arc itself? FFI, a profiler or packaging system would be great.

-----

1 point by thaddeus 5500 days ago | link

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.

-----

1 point by mekon 5500 days ago | link

Factor a fast stack based dynamic language.

-----

2 points by thaddeus 5495 days ago | link

I only spent about 5 min looking at factor. There are many appealing features, but I went as far as seeing "Hello World" and moved on.

Hello World in Arc:

   arc> (pr "Hello World")
   Hello World
Hello World in Haskell:

   Prelude> putStrLn "Hello World"
   Hello World
Hello World in Factor:

   USE: io
   IN: hello-world
   hello ( -- ) "Hello world" print ;
   MAIN: hello
The code syntax is just not pleasant on the eye.

-----

1 point by fallintothis 5495 days ago | link

Actually, you've presented Factor's hello world as though it were a file. They have a REPL, too -- they call it the listener, though. You can either use the GUI version it comes with or from the command line do

  $ factor -run=listener
  Loading ~/.factor-rc
  ( scratchpad ) "Hello word" print
  Hello word
The syntax is aesthetically pleasing in an important way: it's very consistent. While postfix might not look "right" at first, it belies an incredibly simple parsing algorithm -- one that allows for easy definitions of the words like USE: and IN: and even :.

Not that you need to learn Factor. Just sayin'.

-----

1 point by thaddeus 5495 days ago | link

Actually it's not I that present it this way:

http://concatenative.org/wiki/view/Factor/Examples

I presumed that without "USE: io" that "Hello World" was not being sent to the standard output where as my arc/haskell examples actually were. i.e. With arc I could load/run a file/script with (pr "Hello World") and it would output "Hello World", but with Factor?...

I just went to each language site and looked for the Hello World examples. It may be that Factor could do a better job advertising AND that I need to spend more than 5 minutes looking :)

Another language to add to my list to learn....

-----

2 points by fallintothis 5495 days ago | link

Yikes, editing race-conditions. I'll fork this off into a different reply.

I presumed that without "USE: io" that "Hello World" was not being sent to the standard output

Actually, that line's like an import statement in Haskell. I would say it's like load in Arc, but that's not really true; USE: and import have to do with module systems, which Arc doesn't have. If you're already familiar with modules, you can skip this stupid explanation, but...

Basically, modules let you structure your functions into different places so that they don't mess with each other. As a silly example, maybe you write a text adventure in Arc and name a function get, as in (get 'ye-flask). But Arc already defines a function called get, as in (map (get 'a) list-of-hash-tables). You want to be able to use both of them at the same time, but would rather not rename your new function. If Arc had modules, you could qualify the function name with the name of the module in which it's defined. Something like

  (use 'game)
  (game.get 'ye-flask)
  (map (get 'a) list-of-hash-tables)
But when you don't want to use Arc's get, you could still overwrite it with the text adventure's get and not need to prefix it with the module name.

This is a vast oversimplification, of course, but that's essentially what they do. So, in languages like Factor, all the I/O routines are in a module called "io". In the io library is a function called print. If you don't need to print things, you don't need to USE: io, which helps keep the "surface area" of your code small.

i.e. With arc I could load/run a file/script with (pr "Hello World") and it would output "Hello World", but with Factor?...

Because Arc doesn't separate anything into modules, you don't need to import things like pr since it's already there by default. The reason the Haskell code in my other reply could do without the import is that putStrLn is similarly defined in Haskell by default: it's in the so-called "standard prelude". That's what the Prelude> prompt tells you in GHCi. You can import other libraries in GHCi, and the prompt will tell you what you're using:

  Prelude> :m + Control.Monad
  Prelude Control.Monad> :m + System.IO
  Prelude Control.Monad System.IO> :m + Foreign.C.Types
  Prelude Control.Monad System.IO Foreign.C.Types>
Hope that helps.

-----

1 point by thaddeus 5495 days ago | link

> Yikes, editing race-conditions. I'll fork this off into a different reply.

yup... I should really write then post :)

> Hope that helps.

It really does. Thanks for taking the time to reply.

-----

1 point by fallintothis 5495 days ago | link

It may be that Factor could do a better job advertising

True. After all, transliterating the Factor example to Haskell looks something like

  module Main where
  import System.IO (putStrLn)

  hello :: IO ()
  hello = putStrLn "Hello world"

  main = hello
Of course, in Haskell you would just write

  module Main where

  main = putStrLn "Hello world"
My point here is that the Factor code doesn't do any real magic. When you give it a chance, the syntax is quite powerful.

It's really neither here nor there: picking a language and getting at least somewhat comfortable with it is going to be better than endlessly deliberating. They all have their merits (even bad languages!).

I'm babbling. Move along. :)

-----

1 point by thaddeus 5495 days ago | link

It would be nice to see the performance benchmarks on Factor too.

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

-----

1 point by fallintothis 5495 days ago | link

Incidentally, they do implement the benchmark game's programs (and then some): http://gitweb.factorcode.org/gitweb.cgi?p=factor/.git;a=tree...

They just don't want to submit them yet -- work being done on the compiler and such: http://www.reddit.com/r/programming/comments/2krih/factor_90... (granted, this link is a year old)

For some hand-spun results, you can check out http://factor-language.blogspot.com/search?q=shootout or http://factor-language.blogspot.com/search?q=benchmark. I think the most recent results for Factor's benchmark suite are at http://factor-language.blogspot.com/2009/08/global-float-unb....

-----

1 point by fallintothis 5494 days ago | link

For the sake of pedantry, the month-old http://www.reddit.com/r/programming/comments/9ukis/improved_... confirms the year-old reddit post. I would've edited my post, but alas, ran out of time. I'll stop flooding with links now.

-----

1 point by rocketnia 5495 days ago | link

Yeah. I was hoping at least Forth would be on there, but no luck, I guess.

-----

1 point by user2 5489 days ago | link

prolog might have been in the list.

-----