Language shoot-out
[1/19] from: larry::ecotope::com at: 7-Nov-2001 17:01
Hi Maarten
I would also draw attention to the Haskell interpreter, Hugs, which is very
nice for interactive programming ala REBOL:
http://www.haskell.org/hugs/
Also the lazy functional language Clean from the Netherlands:
http://www.cs.kun.nl/~clean/
Clean is very similar to Haskell in syntax but has more optimizations for
scientific and industrial programming. It has a very fast compiler and code
generator with automatic MAKE capability, also a nice time and space
profiler. Using strict evaluation and unboxed arrays, it produces
executables which run about 25% slower than equivalent code in C (in
contrast to REBOL which is more than 100 times slower). It is free for
non-commercial use.
BTW my benchmarks with Scheme and REBOL using DR Scheme showed Scheme to be
faster than REBOL on many programs (especially recursive solutions where
Scheme's tail-recursion converts to iteration) and slower on others. I found
the same with Ruby. It depends on the problem as well as the solution
method.
-Larry
[2/19] from: carl:cybercraft at: 8-Nov-2001 14:35
And perhaps Tao's Elate VP could be added to the list for those who
want to program in a cross-platform machine-code language...
http://tao-group.com/2/tao/elate/vpcode.html
(Not that I've used it. It's just that it looks like cool technology
if you don't mind working at a low level.)
On 08-Nov-01, Larry Palmiter wrote:
> Hi Maarten
> I would also draw attention to the Haskell interpreter, Hugs, which
<<quoted lines omitted: 43>>
>>
>> --Maarten
--
Carl Read
[3/19] from: koopmans:itr:ing:nl at: 8-Nov-2001 11:48
The thing with Clean is that the main libraries are Windows only :(
This is what has stopped me from using it: if it doesn't have TCP, don't
bother...
--Maarten
[4/19] from: jasonic:panix at: 8-Nov-2001 5:49
Surely you gotta include Python ?
http://www.python.org
interpreted, interactive, object-oriented
sometimes described as 'executable pseudo-code'
very readible [smart syntax white space indentation]
dicts and named arguments [Wish REBOL had these]
good community, documentation and books
widely cross-platform [*NIX, Windows, DOS, OS/2, Mac, Amiga and more]
free & opensource
excellent library of bindings, packages, modules, apps..
http://www.vex.net/parnassus/
powerful networking and web components [Zope Cheetah WebWare etc]
friendly and fun!
- Jason
[5/19] from: hallvard:ystad:helpinhand at: 8-Nov-2001 12:09
This discussion reminds me of the one we recently had on text
editors... Except now we all agree to rank rebol very high...
Maarten, since you rank ocaml as no. 2, can you tell me what you think of
it's ease of learning? I've been very curious about ocaml for some time,
but haven't gotten around to taking the time to looking properly into it..
What's the learning curve like?
~H
Jason Cunliffe skrev (Thursday 08.11.2001, kl. 11.49):
[6/19] from: koopmans:itr:ing:nl at: 8-Nov-2001 12:15
But OO and I am converted to a functional kinda guy
On Thursday 08 November 2001 11:49, you wrote:
[7/19] from: koopmans:itr:ing:nl at: 8-Nov-2001 12:52
OCaml takes some time to get used to due to its syntax.
But so did Rebol....
Depending on what you use the curve may be rather steep.
The type/class system is sophisticated, you typically use a lot of recursion,
etc.
I have not climbed the Ocaml mountain completely but I suspect that you have
great views once your on top. Possibly further than Rebol takes you....
[and that goes for Erlang as well]
--Maarten
On Thursday 08 November 2001 12:09, you wrote:
[8/19] from: greggirwin:mindspring at: 8-Nov-2001 11:28
Hi Jason,
<< dicts and named arguments [Wish REBOL had these] >>
I started playing around with both ideas, but haven't tested them
thoroughly.
; Keys don't *have* to be strings, do they?
; If you assign a block to _data, it's up to you to make it a hash! if you
want.
dictionary: make object! [
; Odd items are keys, even items are values. I.e.
; [key1 value1 key2 value2...]
_data: make hash! 50
clear: does [_data: make hash! 50]
count: does [return (system/words/length? _data) / 2]
length?: :count
empty?: does [return count = 0]
keys: does [extract head _data 2]
values: does [extract next head _data 2]
item: func [key] [
if has-key? key [return first next find/skip _data key 2]
]
has-key?: func [key] [
return found? find/skip _data key 2
]
remove: func [key] [
if has-key? key [system/words/remove/part find/skip _data key 2 2]
]
change: func [key value /only] [
either has-key? key [
either only [
system/words/change/only next find/skip _data key 2 :value
][
system/words/change next find/skip _data key 2 :value
]
][
either only [
append/only _data reduce [key :value]
][
append _data reduce [key :value]
]
]
]
contains?: func [value /only] [
either only [
return found? find/skip/only next _data value 2
][
return found? find/skip next _data value 2
]
]
]
; nargs by Ladislav Mecir and Carl Sassenrath
nargs: func [
{The number of the function arguments}
f [any-function!]
] [
-1 + index? any [find first :f refinement! tail first :f]
]
do-fn-named-args: func [fn[action! function!] args[block!] /local arg
fn-args f] [
fn-args: array nargs :fn
foreach arg args [
either (type? (second arg)) = word! [
change/part/only (at fn-args index? (find first :fn (to-word
first arg))) (get second arg) 1
][
change/part/only (at fn-args index? (find first :fn (to-word
first arg))) (second arg) 1
]
]
do head insert fn-args :fn
]
a: [1 2 3 4 5]
do-fn-named-args :length? [['series a]]
do-fn-named-args :append [['value 1] ['series a]]
do-fn-named-args :find [['value 3] ['series a]]
do-fn-named-args :remove [['series a]]
--Gregg
[9/19] from: jasonic:panix at: 8-Nov-2001 13:20
A year ago I was evangelizing Python to a respected programmer friend. His
answer shocked me: "That's all very well, but why don't you switch to a
functional languauge like ML?". He tried to explain about functional
languages.. I didn't really get it but did a littel investigating. Now REBOL
has me hooked and I am honestly not sure quite why :-)
Please would you try to explain to me [multimedia designer geek] what
functional
means in the context of REBOL?
thanks
- Jason
[10/19] from: tim:johnsons-web at: 8-Nov-2001 10:01
On Thu, Nov 08, 2001 at 01:20:02PM -0500, Jason Cunliffe wrote:
> A year ago I was evangelizing Python to a respected programmer friend. His
> answer shocked me: "That's all very well, but why don't you switch to a
> functional languauge like ML?". He tried to explain about functional
> languages.. I didn't really get it but did a littel investigating. Now REBOL
> has me hooked and I am honestly not sure quite why :-)
I think that python and rebol can learn from each other.....
I also checked out the haskell site from this thread and
liked the idea of having BOTH compiler and interpreter.
Apply properly, this could be the best of both worlds!
tj
> Please would you try to explain to me [multimedia designer geek] what
> "functional" means in the context of REBOL?
<<quoted lines omitted: 16>>
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.johnsons-web.com
[11/19] from: lmecir:mbox:vol:cz at: 8-Nov-2001 21:37
Hi Gregg,
the NAMED-ARGS function is a nice idea, although I would suggest a slightly
different design:
named-args: function [
f[any-function!]
args[block!]
] [o stmt fa] [
o: make object! args
stmt: make block! (2 * nargs :f) + 2
insert tail stmt reduce ['return :f]
fa: first :f
repeat i nargs :f [
insert/only tail stmt 'get/any
insert tail stmt to lit-word! pick fa i
]
do bind stmt in o 'self
]
a: [1 2 3 4 5]
named-args :length? [series: a]
named-args :append [value: 1 series: a]
named-args :find [value: 3 series: a]
named-args :remove [series: a]
Gregg wrote: <<
Hi Jason,
<< dicts and named arguments [Wish REBOL had these] >>
I started playing around with both ideas, but haven't tested them
thoroughly.
; Keys don't *have* to be strings, do they?
; If you assign a block to _data, it's up to you to make it a hash! if you
want.
dictionary: make object! [
; Odd items are keys, even items are values. I.e.
; [key1 value1 key2 value2...]
_data: make hash! 50
clear: does [_data: make hash! 50]
count: does [return (system/words/length? _data) / 2]
length?: :count
empty?: does [return count = 0]
keys: does [extract head _data 2]
values: does [extract next head _data 2]
item: func [key] [
if has-key? key [return first next find/skip _data key 2]
]
has-key?: func [key] [
return found? find/skip _data key 2
]
remove: func [key] [
if has-key? key [system/words/remove/part find/skip _data key 2 2]
]
change: func [key value /only] [
either has-key? key [
either only [
system/words/change/only next find/skip _data key 2 :value
][
system/words/change next find/skip _data key 2 :value
]
][
either only [
append/only _data reduce [key :value]
][
append _data reduce [key :value]
]
]
]
contains?: func [value /only] [
either only [
return found? find/skip/only next _data value 2
][
return found? find/skip next _data value 2
]
]
]
; nargs by Ladislav Mecir and Carl Sassenrath
nargs: func [
{The number of the function arguments}
f [any-function!]
] [
-1 + index? any [find first :f refinement! tail first :f]
]
do-fn-named-args: func [fn[action! function!] args[block!] /local arg
fn-args f] [
fn-args: array nargs :fn
foreach arg args [
either (type? (second arg)) = word! [
change/part/only (at fn-args index? (find first :fn (to-word
first arg))) (get second arg) 1
][
change/part/only (at fn-args index? (find first :fn (to-word
first arg))) (second arg) 1
]
]
do head insert fn-args :fn
]
a: [1 2 3 4 5]
do-fn-named-args :length? [['series a]]
do-fn-named-args :append [['value 1] ['series a]]
do-fn-named-args :find [['value 3] ['series a]]
do-fn-named-args :remove [['series a]]
--Gregg
[12/19] from: lmecir:mbox:vol:cz at: 8-Nov-2001 21:51
Hi Jason and Rebols,
once upon a time (long ago) there was a thread named "Encouraging functional
programming". Is there somebody who has got that archived? (I confess that I
lost that when I had to reinstall Windows here).
Jason: <<
A year ago I was evangelizing Python to a respected programmer friend. His
answer shocked me: "That's all very well, but why don't you switch to a
functional languauge like ML?". He tried to explain about functional
languages.. I didn't really get it but did a littel investigating. Now REBOL
has me hooked and I am honestly not sure quite why :-)
Please would you try to explain to me [multimedia designer geek] what
functional
means in the context of REBOL?
thanks
- Jason
[13/19] from: jasonic:panix at: 8-Nov-2001 21:03
> once upon a time (long ago) there was a thread named "Encouraging
functional
> programming".
Hi Ladislav
Thanks. it was an interesting search... I found:
http://www.escribe.com/internet/rebol/m16.html
then
http://www.escribe.com/internet/rebol/m12639.html
but could not find that start of the thread
- Jason
[14/19] from: ammonjohnson:y:ahoo at: 8-Nov-2001 21:22
I did a search for just "Functional". Yeah, I got back a lot of crap, but
with a little wading, I found a rather interesting:
http://www.escribe.com/internet/rebol/m12721.html
Enjoy!!
Ammon
[15/19] from: lmecir:mbox:vol:cz at: 9-Nov-2001 8:50
Hi Jason,
escribe archive doesn't seem to contain the thread. BTW, did you have a look
at my Rebsite (Sites/Ladislav)?
<<
Hi Ladislav
Thanks. it was an interesting search... I found:
http://www.escribe.com/internet/rebol/m16.html
then
http://www.escribe.com/internet/rebol/m12639.html
but could not find that start of the thread
- Jason
[16/19] from: mario:cassani:icl at: 9-Nov-2001 8:30
Hi Ladislav,
> once upon a time (long ago) there was a thread named
> "Encouraging functional
> programming". Is there somebody who has got that archived? (I
> confess that I
> lost that when I had to reinstall Windows here).
is this what you are looking for?
http://www.escribe.com/internet/rebol/index.html?by=OneThread&t=%5BREBOL%5D%
20Functional programming in REBOL
Zaijian
Mario
[17/19] from: greggirwin:mindspring at: 9-Nov-2001 12:11
Hi Ladislav,
<< the NAMED-ARGS function is a nice idea, although I would suggest a
slightly
different design: >>
That's excellent! Thanks!
--Gregg
[18/19] from: lmecir:mbox:vol:cz at: 9-Nov-2001 20:15
Hi Mario,
that was an interesting thread too, unfortunately not the one I meant. The
old one (before november 1999) was really for showing the advantages of the
functional programming style in Rebol. I am pretty sure that it isn't
archived at escribe.
<<
is this what you are looking for?
http://www.escribe.com/internet/rebol/index.html?by=OneThread&t=%5BREBOL%5D%
20Functional programming in REBOL
Zaijian
Mario
[19/19] from: koopmans:itr:ing:nl at: 7-Nov-2001 14:11
While I was at it in my discussion with Joel, I thought I'd do a religiously
tainted language preference shoot-out ;-)
1) REBOL. Reflexive, cross-platform, relatively fast, compact. Made by an
alltime hero (that's you Carl).
2) Objective Caml: Mathematically precise, fast , sophisticated, almost as
fast as C, functional, lost of libs. www.ocaml.org
3) Erlang. A functioanl language that has distribution built-in. Rugby is
modeled after the ! operator in Erlang. Also gives you a RDBMs, httpserver,
etc. in the standard distro. www.erlang.org
4) Glasgow Haskell. Like 2) but with the main developers at micro$oft these
days.
www.haskell.org/ghc
5) Raw C/C++ . For allowing you to implement the rest of the languages/OS'es
6) Scheme. Like Rebol, but slower. MzScheme is nice though.
7) Ruby. If you really want to do OO use Ruby. Also access to its metasystem.
www.ruby-lang.org
--Maarten
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted