comp.lang.forth
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
December 2008
motuwethfrsasuw
1234567 49
891011121314 50
15161718192021 51
22232425262728 52
293031     1
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.forth Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: IF NOTs         


Author: Mike Hore
Date: Dec 25, 2008 22:57

Jonah Thomas wrote:
> ...
> I did a quick test on gForth 0.6.2 on a PC and found the true case was
> slower in roughly the ratio 8:5. This is small enough that it might be
> different on other gForth versions or other PCs.
>
> variable times
> 100000 times !
> : side utime 2>r times @ 0 do dup if else then loop utime 2r> d- d. ;
> : side1 utime 2>r times @ 0 do noop loop utime 2r> d- d. ;
> : test 0 side 1 side side1 ;
>

Well, a bit OT, but hey, it's Christmas. I would think a good
optimizing compiler would optimize the entire first loop away. Maybe
even the second, if it's really clever :-)

Cheers, Mike.

---------------------------------------------------------------
Mike Hore mike_horeREM@OVE.invalid.aapt.net.au
---------------------------------------------------------------
6 Comments
  Re: FFI (Was Re: Your mindset about Forth?)         


Author: Anton Ertl
Date: Dec 25, 2008 12:43

Josh Grams qualdan.com> writes:
>Gerry wrote:
>> Bernd Paysan wrote:
>>
>>> The host system ... must be able to bind to C libraries.
>>
>> I'd like to add that feature to my system but am entirely ignorant on
>> how to go about it at present. Googling returns many hits that don't
>> seem that useful at first sight. Can anyone provide a link to a good
>> guide on how to do it, or provide sample C code for me to adapt?

You can find out some of the thoughts that went into th Gforth libcc
interface in the following papers:

http://www.complang.tuwien.ac.at/papers/ertl07euroforth.ps.gz
http://www.complang.tuwien.ac.at/papers/ertl06.ps.gz

[ffcall, libffi]
>gforth uses a different approach:

Actually, we also used ffcall and libffi, and these interfaces are
still there (and still undocumented) for those who wrote programs
using them.
Show full article (2.28Kb)
no comments
  The meaning of S.W.A.P.         


Author: Albert van der Horst
Date: Dec 25, 2008 02:48

I understand the meaning of SWAP: Single Words on Alternate
Positions.

Now I expect DWAP ( Double Words on Alternate Positions)
SDAP ( Single - Double on Alternate Positions) and
DSAP ( Double - Single on Alternate Positions).

However they are called 2SWAP ROT and -ROT respectively.

So?

Groetjes Albert

;-)

--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
no comments
  Re: The meaning of S.W.A.P.         


Author: Marcel Hendrix
Date: Dec 25, 2008 02:47

Albert van der Horst writes Re: The meaning of S.W.A.P.
> I understand the meaning of SWAP: Single Words on Alternate
> Positions.
> Now I expect DWAP ( Double Words on Alternate Positions)
> SDAP ( Single - Double on Alternate Positions) and
> DSAP ( Double - Single on Alternate Positions).
> However they are called 2SWAP ROT and -ROT respectively.
> So?

Don't drink and derive :-)

-marcel
no comments
  gforth + sdl + ffi         


Author: samsaga2
Date: Dec 25, 2008 01:52

What I'm doing wrong?

Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
s" libSDL.so" open-lib ok
s" SDL" add-lib ok
\c #include ok
c-library sdl ok
c-function sdl-init SDL_Init n -- n ok
end-c-library ok
$20 sdl-init
:8: Invalid memory address
$20 >>>sdl-init<<<
Backtrace:
$B7AE37C0 call-c
$B7AE3750 execute
4 Comments
  There is no usable applications written in Forth         


Author: Ivan Tikhonov
Date: Dec 24, 2008 17:00

That's the problem. Let's face it. Check freshmeat. Check google.
Check forth.org.

Yes, there is cool things like boeing avionics systems and submarines.
But nothing usable for you and me.

And yes, there is eServ and probably more software written in Forth
which do not make this a public fact.

C is known because there was a Unix kernel written in it. PHP is known
because there is a plenty of sites written in it. Python is known
because there is a lot of _usable_ end user software written in it.
Ruby is known because of Rails.

Forth is known because telescope software in NASA was written in it.
Until we change this fact nobody will ever think about using Forth.
Except addicts like me and you.

So may be it's a day to publish something to freashmeat? END USER
USABLE ONLY.
23 Comments
  Re: Your mindset about Forth?         


Author: Ivan Tikhonov
Date: Dec 24, 2008 16:36

On Dec 22, 11:18 pm, Elizabeth D Rather forth.com> wrote:
> Folks, it's simple: if you want to see more people using Forth, you
> have to promote your successes publicly, in whatever publications
> (on-line, dead tree, whatever) people in your target market read.
> People won't try it if they've never heard of it, which is most often
> the case.

Suddenly your message went almost unnoticed :(
no comments
  Re: char and au size         


Author: Bernd Paysan
Date: Dec 24, 2008 15:36

rickman wrote:
> That's impressive that it is getting into silicon. What is the
> application?

It's a battery monitor (things I've been doing already 10 years ago, just
this time a lot cheaper).
> Why are you using a custom CPU instead of a commercial
> chip or core?

Price, power consumption, and development time. It is a lot faster for me to
implement my b16 (a few days) than some pig in a poke bought for a fortune;
and all the other parameters are much better, too. A typical argument is
that only I can program this thing, so this time we made an experiment, and
let a co-worker do the programming: He had a few problems initially, but it
wasn't hard to solve those.
> I have a question on the paper on your b16-small. You say, "The logic
> element that costs most area is the flip-flop." Is this in an ASIC?

Yes.
> I guess the question is what are you comparing this to? I want to say
> I have been told a FF is 10 gate equivalents, IIRC.
Show full article (2.14Kb)
1 Comment
  Re: Your mindset about Forth?         


Author: IanY
Date: Dec 24, 2008 14:06

On Dec 22, 3:08 pm, m_l_g3 yahoo.com> wrote:
> On Dec 22, 9:18 pm, Elizabeth D Rather forth.com> wrote:
>
>
>
>> Jonah Thomas wrote:
>
>> ...
>
>>> There's a pattern I've sometimes noticed with some Forth programmers.
>>> You get a genius amateur Forth programmer who sees a need. He implements
>>> a solution in Forth, complying with all sorts of complicated
>>> requirements. It would at first sight look like more than a single
>>> person could do, but he gives it his best effort and completes it in six
>>> months or a year or two years. Then he releases his project which works
>>> with maybe a few minor problems, and nobody notices. He gets discouraged
>>> and quits.
>
>>> Like, back when 3D graphics were a big deal, a Forth programmer did a
>>> very complicated 3D graphics engine. He used somebody else's drivers for ...
Show full article (4.10Kb)
no comments
  Re: FFI (Was Re: Your mindset about Forth?)         


Author: Gerry
Date: Dec 24, 2008 09:47

jacereda@gmail.com wrote:
> I went the libffi route for my forth and of course it supports
> callbacks:
>
> http://code.google.com/p/fina-forth/source/browse/trunk/kernel/ffi.i
>
> The FFCLOS prim in that file is a helper for implementing callbacks.

Thanks for the link, I'll have a look

Gerry
no comments
1 2 3 4 5 6 7 8 9