Forth Vs Clean Vs J vs Lisp

  • Permalink
  • submit to reddit
  • Email
  • Follow


Dear Friends of Forth,
I have just found Forth and am excited about it. But i need to clarify
its benefits in  pc programming rather than using c, c++ or Java or a
scripting language. Then there is speed of execution. Seems Forth is
like Lisp in that it can be used to write or extend one's own language
because you can build up your own definitions. Lisp is powerful and
expressive and fast prototyping like Forth but usually slow. Forth can
go down further to lower level programming - powerful. But is the speed
one gets without heavy tweaking better than most other languages?
Interpreted Forth competes with compiled other langs or compiled Forth
is competes with c or c++?? Is the time taken to learn Forth going to
get me fast programs??? Faster than J( the apl functional non Von
Neumann  language) or Clean the purely   functional lang with graph
rewriting??
Sorry i don't understand better (yet?). I think because Forth has
assembly  code connections and possibly machine code bit patterns in
memory it wil be very fast executingh . Well worth the time spent
besides the mind expanding nature of Forth 'philosophy' and
programming.
I know shootouts are misleading but in
http://shootout.alioth.debian.org/  Forth was behind Clean and Ocaml an
others. but was this compiled or interpreted Forth??
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=bigforth&lang2=bigforth
has specs on Bigforth.
Hope you can help my confusion by giving an idea of where Forth sit in
comparison to other languages in terms of execution speed. Of course
comments on other joys and benefits of the language are welcome. Thanks

0
Reply peggymark (11) 10/30/2006 8:32:13 AM

See related articles to this posting


On 30 Oct 2006 00:32:13 -0800, peggymark@sriaurobindoashram.com wrote:

>Hope you can help my confusion by giving an idea of where Forth sit in
>comparison to other languages in terms of execution speed.

The range of execution speeds is about 12:1 for current Forths. The
best compete very well with C.

The commercial Forths are the fast ones. Download the free evaluation
version of VFX Forth for Windows from
  http://www.mpeforth.com
and look at the benchmark code. See also Forth Inc's SwiftForth.

Stephen


-- 
Stephen Pelc, stephenXXX@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads
0
Reply stephenXXX (1303) 10/30/2006 12:00:09 PM

peggymark@sriaurobindoashram.com wrote:

> Dear Friends of Forth,
> I have just found Forth and am excited about it. But i need to clarify
> its benefits in  pc programming rather than using c, c++ or Java or a
> scripting language. Then there is speed of execution. Seems Forth is
> like Lisp in that it can be used to write or extend one's own language
> because you can build up your own definitions. Lisp is powerful and
> expressive and fast prototyping like Forth but usually slow.

At least for some modern implementation, that's not true for Lisp, either -
see the shootout. If you weight CPU time, memory use and source size equal,
bigFORTH is now at rank 4 (with one missing item, which runs fine on my PC,
but doesn't run on the shootout sandbox, for yet unknown reasons). If you
drop memory use and source size, it falls behind several Lisp derivatives;
it's about a factor 2 to gcc (which is number one), while OCaml is about a
factor 1.4. Note that the Pentium 4 is distorting the results a bit, I
don't optimize for the Netburst architecture, and never will (it's dead,
Jim ;-).

> Forth can 
> go down further to lower level programming - powerful. But is the speed
> one gets without heavy tweaking better than most other languages?

If you want speed, speed, and speed, you better stick with GCC. This
compiler has more tuning effort put into it than all the other competing
ones. It's not the language that makes it fast, it's the effort.

> Interpreted Forth competes with compiled other langs or compiled Forth
> is competes with c or c++?? Is the time taken to learn Forth going to
> get me fast programs??? Faster than J( the apl functional non Von
> Neumann  language) or Clean the purely   functional lang with graph
> rewriting??

Forth is not "interpreted" in the traditional sense. You have an
interpreter, and an incremental compiler, but the code you typically
execute is compiled. Sometimes to a virtual machine (i.e. with an
interpretation layer below), but nowadays more often to machine code.

> Sorry i don't understand better (yet?). I think because Forth has
> assembly  code connections and possibly machine code bit patterns in
> memory it wil be very fast executingh . Well worth the time spent
> besides the mind expanding nature of Forth 'philosophy' and
> programming.
> I know shootouts are misleading but in
> http://shootout.alioth.debian.org/  Forth was behind Clean and Ocaml an
> others. but was this compiled or interpreted Forth??

Compiled. However, it's different: Gforth is a VM-based Forth; it does
compile to machine code, but only by copying the primitives (no
optimization). bigFORTH has rule-based optimization. VFX or iForth have
analytic optimizations and are typically about twice as fast as bigFORTH,
except where the analytics of these systems is outwitted by clever rules
(main point: global register allocation ;-).

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/
0
Reply bernd.paysan (2418) 10/30/2006 2:07:19 PM

peggymark@sriaurobindoashram.com writes Re: Forth Vs Clean Vs J vs Lisp

>                     Then there is speed of execution. Seems Forth is
> like Lisp in that it can be used to write or extend one's own language
> because you can build up your own definitions. Lisp is powerful and
> expressive and fast prototyping like Forth but usually slow. Forth can
> go down further to lower level programming - powerful. But is the speed
> one gets without heavy tweaking better than most other languages?

As Stephen said: the speedrange for current Forths is at least 1:12.
So, much will depend on the compiler you choose (or can afford).

With my current Forth there's no need to do heavy tweaking anymore. However, 
in Forth datastructures and algorithms are so ridiculously simple to define, 
test, and evaluate for efficiency that it is difficult to resist *not* 
to optimize them. With some care, each project you do will add a number 
of useful and re-usable "words" to your toolchest (so that you have
more time left over for the interesting bits of your problem).

> Interpreted Forth competes with compiled other langs or compiled Forth
> is competes with c or c++?? Is the time taken to learn Forth going to
> get me fast programs??? Faster than J( the apl functional non Von
> Neumann  language) or Clean the purely   functional lang with graph
> rewriting??

Well, C can be from two to four times faster than Forth sometimes 
(pfannkuch was my latest experience). But in this year's ICFP I wrote
the required virtual register machine in just a few hours, so I had 
more time to solve the puzzles (I ranked place 199 out of 361 - I hate
puzzles and dungeon-type adventures). BTW, my VM was only twice slower 
than the best published.

Comparing with J and Clean would be dangerous. These languages 
have some very powerful built-in primitives that can do specific tasks 
very efficiently. I played a bit with J, and the environment is marvelous 
(OpenGL 3D rendering with just a button press, yummy).

> I know shootouts are misleading but in
> http://shootout.alioth.debian.org/  Forth was behind Clean and Ocaml an
> others. but was this compiled or interpreted Forth??
> http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=bigforth&lang2=bigforth
> has specs on Bigforth.

Here you have to be especially careful :-) There are some languages that
'remember' the arguments with which functions are called and cache results.
Of course memoization is useful for some tasks, but standard Forth
applications (memory constrained) generally have no use for it.
Other languages are designed so that it is completely safe to evaluate a 
function with constant arguments at compile-time (sometimes they compile 
VERY slowly :-) It is not difficult to think of benchmarks where these
features would lead to spectacular benchmark results.

> Hope you can help my confusion by giving an idea of where Forth sit in
> comparison to other languages in terms of execution speed. Of course
> comments on other joys and benefits of the language are welcome. Thanks

Some experts (like Paul Hsieh) worry over icc being 10 - 20% faster than gcc. 
If you find that kind of difference mission critical, then Forth is not 
for you ...

-marcel

0
Reply mhx (2135) 10/30/2006 6:18:52 PM

Wow! You guys are great!! thanks for all the good feedback. SO nice to
get informed usable pertenant information sooo fast. There is so much
for me to learn and much sounds fun. I was asked to work on OpenBios so
i have a geat excuse to learn Forth. I am reading Brodie's books. I
have found HLA assembly language allowing higher level constructs on
top of assembly. SO i will try to learn assembly instructions and how
it works and then build my own words in Forth to write my a own
"functions" and build up from there. I think i have the usual newbie
fear that Assembly dwarecoding is too time consuming and tedious -
while forth can be fun yet still time consuming. And for both one needs
to know more technical lower level dynamics of computer hardware.
I am opting for the new paradigm and adventure.

Anyone wish to input on why they love Forth. Would be inspirational for
a kick start. What you can do with Forth you can't or wouldn't in other
languages, why its more fun in Forth and freeing etc.

Many thanks again for taking the time and care to help out one in
search.
Markandeya

0
Reply peggymark (11) 10/31/2006 7:10:38 AM
comp.lang.forth 5998 articles. 4 followers. Post

4 Replies
184 Views

Similar Articles

[PageSpeed] 57


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

forth vs common lisp vs blah for website
will there ever be stuff like this for forth: http://restas.lisper.ru/en/overview.html#overview http://wuwei.name/ http://common-lisp.net/project/ucw/features.html http://web4r.org/en/ Now I know Charles Moore passed over lisp on his way to making FORTH. What would Charles, if he is listening, do to make website development easy? Would he avoid html? On 5/15/11 2:45 AM, gavino wrote: > will there ever be stuff like this for forth: > http://restas.lisper.ru/en/overview.html#overview > http://wuwei.name/ > http://common-lisp.net/project/ucw/features.html > http://web4r.org/en/...

forth vs lisp
anyone know both? which do you prefer? In article <fa7d1e92-d47e-4324-a17a-90490695efaf@v13g2000pro.googlegroups.com>, gavino <gavcomedy@gmail.com> wrote: > anyone know both? > > which do you prefer? Gavino has asked that question already fixnum+ times. ___________________________ /| /| | | ||__|| | Please don't | / O O\__ feed | / \ the trolls | / \ \ ...

forth vs lisp #2
opinions? On 8 Nov, 12:17, gavino <gavcom...@gmail.com> wrote: > opinions? they are simply best friends, jus' like you'n me. P.S. the only real difference is that Forth was inspired by the number 4, and Lisp by the number 7 (the number tells it all). gavino <gavcomedy@gmail.com> wrote: > opinions? My opinion is your a dumb motherfucker My opinion? Lisp is prefix FORTH. That hit me right off the bat when I started learning Lisp. Similar (for a beginner) experience of working with symbol table + interpreter. Prefix requires full parenthesisation, whereas pos...

forth vs common lisp
cl claims to be the most powerful programming language in the world!!! can forth outdo it? www.paulgraham.com On Apr 14, 8:05=A0pm, quiet_lad <gavcom...@gmail.com> wrote: > cl claims to be the most powerful programming language in the world!!! > can forth outdo it?www.paulgraham.com cl *itself* claims that? Why, sure, Forth can outdo that ... those, OTOH, most any language can: : .Forth-Claim ( -- ) CR ." I am more powerful than the most powerful " ." programming language in the world ! !! !!!" CR ; Outdoing *claims* is easy. Its backing them up...

forth abstraction vs lisp macroes
can forth build up abstractions such as lisp macroes can? are there some kind fo techniques ? ...

forth vs golang erlang haskell commmon lisp prolog can forth outdo all there? less code? good concurrency?
yea? duminic=C4=83, 14 septembrie 2014, 02:40:20 UTC+3, gavino_himself a scris: > yea? Gavino, say so, are you werty? On Sunday, September 14, 2014 3:40:20 AM UTC+4, gavino_himself wrote: > yea? All these langusages are very difficult to compare. Forth is almost all I n= eed to work with the embedded systems. What about other langs? It's not so = flexible when I really need to change something in my app. I need full stac= k of some stuff like OS, compilers, build tools, and otherstaff to make som= e changes within my app. Forth is the single thing I really need in c...

LISP vs HASKELL vs PROLOG
I'm not trying to start a flame war about which one is the best. Could anybody explain me each of these languages features and strong points ? !!!@!!! wrote: > I'm not trying to start a flame war about which one is the best. Could > anybody explain me each of these languages features and strong points ? I know a bit Common Lisp, but I'm still lisp toddler. I can barely understand haskell, and have troubles reading prolog code. So Common Lisp is multi-paradigm language - you can code in many different ways. Strong points are powerful macro system, continuous development ...

paul grahams arc, a new lisp, and his words about makign code shorter, vs forth?
http://paulgraham.com/arc0.html I know forth code is SHORT, and mr Graham is having arc 'mkae code shorter' The kind of dirtiness Arc seeks to avoid is verbose, repetitive source code. The way you avoid that is not by forbidding programmers to write it, but by making it easy to write code that's compact. One of the things I did while I was writing Arc was to comb through applications asking: what can I do to the language to make this shorter? Not in characters or lines of course, but in tokens. In a sense, Arc is an accumulation of years of tricks for making programs shorter. Sou...

WJ vs. Gavino... Factor vs. Forth
This is going to be the battle of the... I'm not sure what this is going to be. So far they have just circled each other with no contact. -- Rick On 4/13/13 11:20 AM, rickman wrote: > This is going to be the battle of the... I'm not sure what this is going > to be. So far they have just circled each other with no contact. > I wish the whole thing would just go away. It's not much of a spectator sport. Cheers, Elizabeth -- ================================================== Elizabeth D. Rather (US & Canada) 800-55-FORTH FORTH Inc. ...

J vs kx/Q vs APL
How would you guys compare J to kx/Q to APL? If one is to learn some, is it OK to start with Q or J (seems to have only ASCII characters), and then which -- Q or J? Are any of these compiled, and can you link some to OCaml compiled natively? Cheers, Alexy "braver" <deliverable@gmail.com> wrote in message news:2b75ebdd-09b3-4caa-87b2-f5a5d830c335@f40g2000pri.googlegroups.com... > How would you guys compare J to kx/Q to APL? If one is to learn some, > is it OK to start with Q or J (seems to have only ASCII characters), > and then which -- Q or J? Are ...

WHAT vs HOW vs WHERE
In the ongoing discussion here about alternatives to the RM, the subject of pointers keeps coming up. AFAIK, one of the features of the RM is that the interconnectedness of data is established by common data values, instead of pointers. In my view, pointers are "good things" not "bad things". But there are plenty of "good things" that will harm you if you don't use them right. One of the ways a network or graph data base achieves performance is by the efficient use of pointers, and the strategic preplacement of pointers where they will be need...

ex vs. em vs. px vs. % vs. in.
Hello All, I am looking for a for a good tutorial on font size definitions in a CSS. A URL to a good tutorial with demo/example will help. I am trying to create a CSS for DocBook XML Document, but I m unable to get a cross browser/platform compatibility. I want the documents to look fairly similar on all platforms/browsers. Here is my CSS -> http://www.xml-dev.com/blog/new.css And here are 2 plaint text documents using that CSS: http://tinyurl.com/yu3j8 http://tinyurl.com/2zwoh More documents here -> http://www.xml-dev.com/blog/#88 I was told that I should always use...

C vs Forth vs whatever Executables for Hello World
In a recent thread in comp.arch.embedded entitled "Where does C++ fit in?" some people were comparing executables for C and C++ for Hello World examples. Now I know a .COM file in DOS can do it in <30 bytes. But I was supprised to see the size of the executables generated by C and C++ (presumably for a Linux system (and in a thread about where C++ fits into embedded system use). Those numbers ranged from about 2700 to 388,000 ( -static) after the application of -strip. With -static and before -strip the size was a whopping 1.7M. Now I know that TCOM when targeting for DOS prod...

Lisp vs. Java vs. C++ speed comparison time?
I must admit, I'm not much of one for speed benchmarks. They're simple, don't demonstrate much, and they're kind of silly. But when I see how much publicity was just won over at Slashdot for http://www.sys-con.com/story/?storyid=45250 it makes me think... I think we, as a group, should set up a comparison of Lisp performance vs. Java Performance vs. the reference C++ performance. I suspect that if we use a commercial lisp compiler like ACL or LispWorks, we'll see comparable results, and if we do, then we've got a time window right now where we can make a lot of positiv...

JSP vs. Struts vs. JSF vs. Swing vs. Tapestry vs. Spring vs. Rails
I am a JSP developer and am constantly feeling like I am missing the boat by not using any of the other frameworks out there. However, the couple I have looked at (JSF and Rails) don't impress me. In JSP, I keep all of my logic in Servlets/Beans and all of my presentation in the JSP file, making custom tags when I need to do some HTML that involves some logic. So Servlets and Tags are the glue to the JSPs and Beans. I don't see what is wrong with this model. The biggest advantage is its flexible. An example of my frustation with JSF (which is different than all the other complaints...

Magic vs MiNT vs Gevena vs TOS vs...
Hi all, I'm starting this thread for 2 reasons: a) I'm a bit tired of reading the same subject again and again and decided to give it a little twist, b) Personal need. So, without any further ado, my situation is this: I have a stock STE with 4 Megs of memory, in which I'll be adding a hard drive (and maybe more) in this week. Being a floppy user (Atari-wise) all these years I never thought of having any other OSes than plain old TOS, but now, since I'll be getting some more space, I thought I might as well throw in a desktop/accs/resident progs setup there as well...

NYC LOCAL: Tuesday 10 August 2004 Lisp NYC: Gnumeric vs Cells vs Multitudinous Things from Universe Lambda
<blockquote what="official Lisp NYC announcement"> Subject: [Lisp] Lisp meeting, August 10th 7:00 at Westside Brewery Why bother with silly things like Alien vs Predator when you can determine a better shootout: Lazy Evaluation vs Special Forms! Please join us for our next meeting on Tuesday, August 10th. Lisp NYC will be meeting at the Westside Brewery (340 Amsterdam Ave. off the 1,2,3,9 subway between 76th-77th) from 7:00 to 9:00 PM. - Heow P.S. Trinity Lutheran (on B & 9th) has a scheduling conflict this month but ...we're more than welcome to have future m...

NYC LOCAL: Tuesday 10 August 2004 Lisp NYC: Gnumeric vs Cells vs Multitudinous Things from Universe Lambda
<blockquote what="official Lisp NYC announcement"> Subject: [Lisp] Lisp meeting, August 10th 7:00 at Westside Brewery Why bother with silly things like Alien vs Predator when you can determine a better shootout: Lazy Evaluation vs Special Forms! Please join us for our next meeting on Tuesday, August 10th. Lisp NYC will be meeting at the Westside Brewery (340 Amsterdam Ave. off the 1,2,3,9 subway between 76th-77th) from 7:00 to 9:00 PM. - Heow P.S. Trinity Lutheran (on B & 9th) has a scheduling conflict this month but ...we're more than welcome to have future m...

Lisp vs. Common Lisp
I'm deeply interested in Lisp. I'm learning it through Peter Seibel's PCL. One comment I find a lot when people talk about Lisp is that Lisp is wonderful, but CL has a lot of problems (problems I cannot understand due to my newbieness). Now, I don't want to learn the wrong Lisp. What do people mean by Lisp in this context? Is it Lisp 1, Lisp 1.5, the particular dialect they used and fall in love with? If this unidentified Lisp is so great, why don't they use it and avoid all the pitfalls of CL? On Sat, 12 Jun 2010 09:36:50 -0700, Simon wrote: > I'm...

PowerPC vs. TI DSP vs. IA32 vs. MIPS vs. H8 ...
Hi All, I need to select a platform for a control project. I need suggestions from your guys. Here is the some requirements for the project: 1) Programming in c 2) Two channels of AD > 12bit 3) Two or more quadrature decoders (single ended) 4) > 1 channel of PWM output 5) floating point performance ~ 500MHZ P3 6) Small, reliable and takes only 12V power supply 7) ~32MB DRAM (I really don't know how much my program will require, how to estimate this?) 8) ~32MB FLASH prefer also a VGA display for a color flat panel display. Multimedia Card (or compact flash) interface. Thanks in ad...

fastcgi vs mod perl vs apache vs lighttpd vs perlbal
what is fastest combo folks? >>>>> "g" == gavino <gavcomedy@gmail.com> writes: g> what is fastest combo folks? (no doubt referring to this:) Subject: Re: fastcgi vs mod perl vs apache vs lighttpd vs perlbal It depends on your configuration and what you're doing. Performance for all of them is configuration-dependent: an installation of any of them, tuned to suit your application's specific performance needs, them will most likely perform better an untuned installation of any of the others. (Did you finally get tired of trolling comp.lang...

vi vs. vim vs. emacs vs. ????
I've decided to step back from the IDE and start learning/re-learning Java without the aid of Eclipse or Netbeans. I want to learn about packages and such without having an IDE do all the work for me. So my question is, what's the best editor on a *nix platform? I am somewhat familiar with vi and emacs so I'm trying vim out as my Java editor. Are the others that are better or is a vi* editor a good choice. Not flame bait..just looking for some honest opinions. On Jun 16, 10:54 am, JT <jtlinux1@yaho#Akd9i30.ca> wrote: > I've decided to step back from the IDE a...

Comparisons of TeX vs Groff vs SGML vs DocBook vs TeXinfo
Well, I've had fun with Tex and LaTeX for a while now, but I'd like to know how well the alternatives work, and weather or not I should use these alternatives that are listed usually with TeX. What are your opinions on them, and surely, some must do a job better than the rest (Something must do pictures and tables better) and I probably will use the best one for the specific jobs that may come up in the future. Basically, I'm just asking for a list of strengths and weaknesses that each of these typesetters or document language things have. Thanks Percival Percival Tiglao wrote:...

Qedit vs CodeWright vs Whisper vs ?
I've been a fond fan of Qedit(host) for many years now; already knowing this editor leads me to stay with it when looking for a good client/server editor. But I admit I've also had my head in the sand for years, happily grinding away at my Cobol/Image code, getting real work done, going home tired. Meanwhile, the world's grown up without me. Would you fine folks be so kind as to share your experiences with C/S editors? I know I'll still be working on good old HP3000 Cobol, but now I'm getting into the Unix world, and will probably appreciate having something l...