On Mon, Nov 15, 2010 at 04:29:15PM -0500, Henry Olders wrote: > On 2010-11-15, at 14:34 , Pablo Duboue wrote: > > > On Mon, Nov 15, 2010 at 12:32 PM, Henry Olders <[email protected]> > > wrote: > >> Why erlang? It's a functional programming language, and it provides for > >> concurrency. > >> > >> More specifically, I've developed a neural network based nearest neighbour > >> classifier, which I had programmed in MacForth initially, then > >> reprogrammed in python when MacForth support stopped. Unfortunately, the > >> python implementation is considerably slower than the forth; in addition, > >> I need to add some functionality to the program which will require > >> refactoring a significant portion of the code. I am seriously considering > >> doing this reprogramming in another language, thus looking at functional > >> programming languages. Haskell is not intuitive for me, erlang much more > >> so. Also, since a number of the processes in my neural network can > >> operate concurrently, I like the idea of writing it in a language which > >> will give a speed boost on multicore machines. > >> > >> I'm looking for people to exchange ideas with! > > > > Have you tried scala [1]? > > > > I like the ideas behind Erlang but dynamically typed languages make me > > uneasy. > > > > If you want to exchange ideas, stop by at the open house at Foulab [2] > > tomorrow 8PM and we can talk a little bit. NN in Forth sound very > > nice. Have you considering moving it completely to hardware using a > > FPGA? > > > > (Also, you can find me on Freenode on ##foulab, I'm DrDub.) > > > > Best regards, > > > > Pablo > > > > [1] http://www.scala-lang.org/ > > [2] http://foulab.org/ > > I've avoided statically typed languages because my programming style works > best with a very fast turnaround like you get with an interpreter. I do > believe in strong typing, though, as with python. But I can also live with > untyped languages - thus my use of forth and, many years ago, assembler. > > When I looked at Haskell, I was impressed with user-defined types as a > way to avoid bugs; much nicer, I think, than classes.
Another language in the same class is OCaml, or its close relative, Caml. The *big* difference is that they don't do lazy evaluation by default. As a result it's possible to have some control over evaluation order so that your memory consumption doesn't blow up. As an other result, side-effects are allowed. You're allowed to have storage cells whose contents vary with time, which is essential for some algorithms. > Erlang apparently allows types, including user-defined types, to be > specified for functions (both arguments and results), and there is a > tool that does type-checking, but I haven't gotten that far yet. > > I've also stayed away from languages, like C and its variants or Java, > that require all sorts of extra text and declarations to get anything > done. Time-wasters, in my opinion. You might appreciate Gambit, a Scheme implementation that interfaces very well to C. In fact, it's implemented by translation to C. Racket, formerly known as PLT Scheme, also has a type-checked version, called Typed Scheme, or Typed Racket. > > After my very positive experiences with list comprehensions in python, one of > the the first things I look for in a language is how easy it is to program > them (and of course test them in an interpreter). In python, a list > comprehension to extract even numbers from a list of integers L looks like > this: [x for x in L if x%2==0] ; (ie 24 characters). In Erlang: [X||X<-L,X > rem 2==0]. (21 characters). Both of these can be run directly in the python > interpreter or the Erlang shell, respectively. I understand that scala has a > sequence comprehension, but I suspect it will take more characters to > implement and to test than in python or erlang. > > Henry > > _______________________________________________ > mlug mailing list > [email protected] > https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca _______________________________________________ mlug mailing list [email protected] https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca
