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 6039 articles. 4 followers. Post

4 Replies
253 Views

Similar Articles

[PageSpeed] 47


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

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

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

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

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

comparision Jini vs CORBA vs .NET remoting vs. DCOM vs. web services vs. Java RMI
Hi, Would it be fair to compare the following technologies to each other: Jini vs CORBA vs .NET remoting vs. DCOM vs. web services vs. Java RMI? Thanks, Derek On 4 Nov 2005 20:53:09 -0800, "derek" <derek_t_9953@yahoo.com> wrote, quoted or indirectly quoted someone who said : >Would it be fair to compare the following technologies to each other: > >Jini vs CORBA vs .NET remoting vs. DCOM vs. web services vs. Java RMI? > You can compare them. They each have their niche so they are not direct competitors.. CORBA's forte is interlanguage communication -- ty...

Websh vs Rivet vs AOLServer vs PHP
Until now, I've always used PHP for web development. I would like to try Tcl out, but there are so many options. I read that Websh works in Apache 1.3 and 2.0, but Rivet (according to http://tcl.apache.org/) only works with Apache 1.3. As far as I can understand, these both implement different APIs. Then there's AOLServer, which implements yet a third API. What are the relative merits of each of these packages? Specifically, are any of them particularly light-weight? As in lighter than PHP? More importantly, are any of these packages likely to be updated much? It seems li...

Asus vs Toshiba vs IBM vs MSI
Hi I'm looking to possibly buy a laptop around August this year. How would Asus, Toshiba, IBM and MSI compare with reliability, warranty and customer service/technical support? I've read about Toshiba and IBM changing ownership of parts of their companies. How has this affected things? I'd also appreciate any recomendations for other brands for Windows laptops. I'm also thinking of dual booting with Linux (probably Ubuntu) I'm a part time IT student and I'm trying to start up a business using php and Java so I'm looking for a good brand. I'm in Melbourn...

ASSOC vs SHMMAP vs POINT_LUNs vs READ_BINARY?
I have a large multidimensional array. I want to sort it, without doubling the memory requirement by making a same-size array and copying data over, sections at a time. I hear about: - ASSOC? But the raw data is not in large consecutive chunks. Does this preclude its use? - SHMMAP? Seems very low-level and risky without experience. - READU and lots of POINT_LUNs? Would this execute slowly? - READ_BINARY with the TEMPLATE keyword? I should like to hard-code the template rather than use the BINARY_TEMPLATE GUI. I suppose this is possible? I am guessing that READ_BINARY with TE...

ScreamerNet vs. TequilaScream vs. Amleto vs. Spider?
I would like opinions from those who have used third-party Windows network rendering packages for Lightwave (versus the supplied ScreamerNet). Specifically, I'm looking for the pros and cons of using TequilaScream, Amleto, Spider, etc. Best Regards, Washington Bob "Washington Bob" <washington_bob@hotmail.com> wrote in message news:5403d5d.0401161757.18a6648b@posting.google.com... > I would like opinions from those who have used third-party Windows > network rendering packages for Lightwave (versus the supplied > ScreamerNet). > > Specifically, I'm loo...

ATI vs Sapphire vs PowerColor vs etc
Hi there, I've been out of the computer market for awhile now. What's with all these other companies carrying ATI products. For example, I can get a Sapphire Radeon 9600 or a PowerColor 9600 and ATI still has their own 9600. I am seeing these supposedly same products at different prices. What is the difference between the companies and which one would you recommend I get? I am not a gamer. I may do some light video editing though. Thanks for the help. Kindly appreciated. "Kevin" <kevin_uoft@hotmail.com> wrote in message news:5a7a1cbd.0410201540.29397c48@posting.goog...

Perl vs Python vs Ruby.... vs Tcl?
Hello. I found this page interesting http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/ Would someone care to show me how this would be done in Tcl please? Thanks. fro...@gmail.com wrote: > Hello. I found this page interesting > > http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/ > > Would someone care to show me how this would be done in Tcl please? > Thanks. Probably by using the tcllib csv module and adding some lsearch/lsort - index trickery for Tcl 8.5 or simple iteration with foreach. Michael On 11 sep, 16:31, schl...@uni-oldenburg.de wrote: >...

C++ vs Java vs OCaml vs SML
I have written a web page comparing the verbosity and speed of four different (progressively optimised) mini ray tracers written in C++, Java, OCaml and SML: http://www.ffconsultancy.com/free/ray_tracer/languages.html Essentially, the results indicate that Java is extremely slow (5x slower than the fastest implementation) and extremely verbose, OCaml is extremely concise (only 60 lines of code for the minimal implementation of the ray tracer) and Mlton-compiled SML is extremely fast (much faster than the other three languages). -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffco...

PHP vs. Ruby vs. Python (vs. Rails)
------=_NextPart_000_009F_01C4D6B5.63C44BD0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit As I was falling asleep last night I was wondering about the differences in terms of web development time and effort between PHP, Ruby, and Python. and I found myself wondering how much effort the Rails framework saves me from. Does anyone else out there have the experience to be able to compare these? I'm partly curious because I've found it so difficult to get Rails going on windows, while PHP was comparatively very easy. And Python I've just heard ...

wrapfig vs. picinpar vs. picins vs. floatflt
I am looking for a package that allows pictures next to text. Now I would like to know how these packages differ and what are their good and bad sites. The things I found so far: * picinpar and picins do not float (not necessary needed by myself) * picinpar is Latex209 * picins is Latex209 * wrapfig is newest (but has very unsuable documentation) * only pininpar allows full textlines before picture starts (very important feature!) * floatflt has less options than wrapfig Things I do not know: - do they accept the caption seetings from Komascript (are they compatible) ? - which is still deve...

Tao vs Mico vs omniORB vs Orbit2
Hi, could you give some advice for choosing one of the open source C++/C ORBs Tao, Mico, omniORB or Orbit2? I know this was discussed many times in this group, but mostly at least 5 years ago (maybe with exception of <j4Kdnavx0vTpOdXfRVn-gA@speakeasy.net>). Fife years is a very long time in computer science, and I think the products should have ripened a lot in the meantime (some might not have changed at all, which says something, too). So, what is the state of the C++ open source orbs today? Which one is used most (Orbit2 I'd guess, because it is the work horse of t...

(datafit vs reglin) vs maple vs TI
Hi, I want to find a quadratic model y = a*x^2 + b*x + c x with these data : x=[2.4126707 2.9818986 3.0036434 3.3531706 3.8658704 4.1378644 4.3402778 4.5696145 5.2653294 6.1056737 ]; y=[1.6156458 1.6204804 1.6208537 1.6239252 1.6285508 1.6309426 1.6329042 1.6350602 1.6417699 1.6502698 ]; Using the Scilab datafit function, I get : a=0.0002385, b=0.0073295, c=1.5965995 Using the Scilab reglin function ([a,b]=reglin(reglin([x.^2;x],y)), I get : a = 0.0002397, b= 0.0073193, c= 1.5966194 The difference is small, but not neglig...

Re: Qedit vs CodeWright vs Whisper vs ?
Hi Tracy :) I don't honestly know if I would call it an C/S Editor ... but I have been using a product called UltraEdit/32 or something like that and have been very pleased... does Hex conversion on the fly and all kinds of other stuff...that I used in Qedit all the time... url is http://www.ultraedit.com/. I am not sure if it is free or what ... Regence has a very large (5000 user) license so .... we use it alot ... Art "just my 2 cents worth.... which ain't much comin' from me! hehe" Bahrs ======================================================= Art B...

JOGL vs Java3d vs LWJGL vs Xith3D
Hi, I would like to use OpenGL (or 3d hardware accelerated engine) under Java. I would like to play around with Shaders (OpenGL 1.5).....and I don't know much about OpenGL (but I'm not afraid in learning). What is best environment : JOGL, Java3d, LWJGL or Xith3d Could you please help me to find out which is the simpliest to use, the less buggy. Do you think that Java3d will rapidly evolve now that source code is open? Which one is the fastest layer for opengl (best performance)? Unfortunatly documentation is not the best for 3d Layers in Java. Could you please gi...