Re: 2.6 feature request: foreach (off topic)

new topic     » topic index » view thread      » older message » newer message

Juergen Luethje wrote:
> 
> Vincent wrote:
> 
> <snip>
> 
> > Me and Liquid Nitrogen have begun using a language called PureBASIC. He
> > seemed to learn it in a matter of a couple of days, Im learning slowly.
> > It has some really nice features.
> >
> > It has all those For/Next, ForEach, Repeat/Until, While/Wend, and
> > ofcource the iteration flow statements: break [loop], and continue.
> 
> As you know, most of them are also implemented in Euphoria. I would like
> to have 'Continue' (and also something like 'Repeat/Until'), though.

Oh yea... there is Case/Switch, and CompilerCase/CompilerSwitch as well.

> 
> > Plus goto, gosub, etc.
> 
> No, thanks!

I wont EVER use "goto <label>" and "fakereturn", and only use "gosub" and
"return" when nessesary, otherwise just direct routine calling.
Kat consistantly pesters Rob to implement it, but I highly doubt it will ever
happen.

> 
> > What I like the best are: Pointers,
> 
> I took a look at the German PureBASIC forum and saw people discussing
> the "best way to shoot themselves in the feet" by (ab)using pointers.
> 

In my case it's alot worse without them, trying to "simulate" structures &
passing pointers to members in it. using peek4u/s, and poke4. I had just enough
of that nonsense with routines from the graphics subsystem for the SDL wrapper.
There are libraries, like Structs.e, but they create some considerable overhead,
and still isn't as good as being built-in.

> > structures, unions, interfaces (for OOP modules), dimentional arrays,
> > dynamic linked lists (sort of like sequences),
> 
> As far as I know (as a layman), we only can "walk" through a dynamic
> linked list, going from an element to its successor (and to its
> predecessor, if there is a link to it, too), but we can't access an
> element of a linked list by an index. So it seems to me, that Euphoria's
> sequences combine the advantages of both arrays and linked lists.
> 

SelectElement(LinkedList(), Position)   ; Position = index

Description: Change the current list element to the element at the specified
position.

Index = ListIndex(linkedlist())

Description: Find out the position of the current element in the list,
considering that the first element is at the position 0.

there are 14 commands total for dealing with linkedlists. The ForEach loop
method was designed exclusively for it, "if" you want to scan through each
element. Dynamic linked lists arn't as functional or elegent as sequences, but
they only represent one method of storing large amounts of data in PureBasic.

> > data sections, static arrays (for structures), inline ASM, etc.
> >
> > The core libraries are very complete, there is virtually EVERYTHING!!,
> 
> I didn't see libraries e.g. for TCP/IP or for Regular Expressions (both
> IMHO very important these days), but I must admit that I didn't take
> very long time for searching.
> BTW: The first two demo programs that I tried didn't run. Not very
> convincing ...

PureBasic comes with a complete networking core library, supported on all
current platforms. It has 19 commands for dealing with the TCP/IP protocal. There
is an small internet browser, atomic webserver, atomic ftp server, and a network
server & client example programs. I'm not sure what you mean by "regular
expressions", but I bet whatever your wondering about is there. If not, there is
a site with 149 free user written core libraries, plus alot of other resources..
Plus there are many other user sites with their libraries and programs on it.

> 
> > all written and compiled in optimized ASM for super speed (over 600
> > functions).
> > You can make core libaries in ASM or C, you can make and use your own
> > DLLs/SOs, and ofcourse make PureBasic written libraries that you
> > "include" into your programs.
> >
> > Its a compiled language... but the compiler can handle 300,000 lines a
> > code per minute on a old Pentium 200 MHz. I have a Pentium 4, 2.66 GHz,
> > with 512 MB DDR (1 GB soon), so yea. Plus it compiles to optimized x86
> > or 68000 or PowerPC ASM, which assembles to produce very efficent EXEs
> > or DLL/SOs that are extremely small & fast.
> 
> After what I read, it's even better! The PureBASIC code is translated to
> ASM code, and then compiled by FASM. Before compiling, the programmer
> can tweak the ASM code by hand.
> That's really cool! Pete's Posetf does the same. smile

Yep, using the /COMMENTED compiler flag, you can produce an ASM output file.
When your done optimizing you can use /REASM to assemble it into an EXE or
DLL/SO. However in most cases that would be rather pointless (unless your a speed
freak), when the speed and size is already amazing.

Cool, but how many people actually use Posetf? blink.

> 
> > (as small as 2 KB, as fast as C++ in most cases or even faster
> > {Interpreted Euphoria handles large/huge sequence operations "slightly"
> > faster though}).
> >
> > There is implementations for Windows, Linux, AmigaOS 3+, MacOS X (new),
> > and comes with an nice editor,
> 
> The editor is very simple compared to currently available free editors
> such as ConTEXT, ...

Yea, textpad is nice.. You can integrate the PB compiler quite easily with
macros. But I find the included editor good enough though.. It will list my
procedures, has syntax highlighting, tabbing, line numbering, all the basic stuff
I want.

Now ED is at most an satisfactory DOS editor. It isn't much better than MS-DOS
EDIT.EXE. Now maybe it isnt RDS's job to come up with an modern editor, but it
seems RDS really hasn't been doing much with improvements to the main product now
havr they?

> 
> > and GUI form designer (new designer coming out), plus there is
> > PureVision (proffessional form designer).
> >
> > What is really catchy about it is... it is very simple to learn,
> 
> I think here is a contradiction. When it has soooo many built-in
> routines, then this is confusing especially for beginners, and not
> simple to learn. IMHO it's somewhat typical for BASIC, that there are
> special keywords or built-ins for almost everything -- not simple.
> 

There arn't "built-in", if they are "core" libraries. You can use them as if
they were, without needing to include a file into the source.

Also, all routines (commands) are categorized by function. You need only
reference them, and eventually you will memorize the ones you use the most.

> > almost as simple and elegent as Euphoria
> 
> Not in my opinion. I have been programming in PowerBASIC for some years.
> It was OK for me at that time, but since I know Euphoria, BASIC syntax
> looks somewhat ugly for me (just my personal feeling).
> 

PowerBASIC syntax is almost completely different from PureBASIC's. I would
prefer C syntax over that of PowerBASICs. Just go compare for yourself.

> > (the learning curve is small), and C/C++ interfacing is MUCH easier.
> > The syntax is only a couple of steps below Euphoria (alot nicer than
> > traditional basic).
> 
> The syntax is pretty similar to traditional BASIC as far as I could see.

There are many similarities, but overall I find it alot nicer than that of say
Qbasic. To me its close to Euphoria's elegence and simplicity, without the
limitations.

> 
> > The price is right as well... $70 USD (59 Euros) for a license on all
> > platforms. Plus all the upgrades, on all platforms (including new ones)
> > are free "forever" from then on.
> 
> Did you ever look at PowerBASIC? I believe it's more powerful than
> PurBASIC, so it might be useful for you. But it's also more expensive,
> and I don't know whether they have already done a Linux version.
> 

More Powerful? LMAO!
I bet you agree Euphoria is "More powerful than C++" don't you?

It is alot more expensive, and the upgrades arn't free. $99 for the MS-DOS
compiler, $199 for the Windows one. So if I wanted to have both, I would be
paying $298.. Nice... I wonder if I can pull that cash out of my A$$.

> > I'm still going to use Euphoria for any DOS programs & libraries I
> > happen to make.
> >
> > I probably should not have mentioned this in an Euphoria message board,
> > so forgive me on this too.
> 
> IMHO we should use Euphoria because we are convinced that it's the right
> tool for what we want to do, not because we don't know what other tools
> are available. blink

Fair enough, you are convinced. Not me, ohh no. But if Rob makes something good
for v3.0, I might have a second thought. It wouldn't really matter though,
because I dont normally release my work to the archives. So it wouldn't benefit
you guys any. :P

Besides I dont think Rob is gonna do anything more than what is posted on the
"Future" page, other than various minor tweaks. But I guess I dont need to worry
about that anymore. A team of 6 people are developing PureBasic, and they dont
think like Robert Craig does. I know 2 of them do the main coding, and one does
the libs, and one does the Form designer (IDE), the rest probably do work on the
other platforms.

Lets compare that to the Euphoria development team: "Robert Craig"; An Army of
one. :P

I'll say this much though... Robert Craig seems like a nice guy though, 
I'm not at all trying to criticize or insult him at personal level. smile
I respect the work he has done and consider Euphoria a genious creation, but he
alone just doesnt have the capacity to produce a "proffessional" language with
"proffessional" tools, that is necessary to compete with the rest of the big
timers; Nor does RDS have the right marketing strategy.

I think he should continue what he has been doing, so he can get some extra
income to pay the bills, and buy that Canadian beer. grin

> 
> Regards,
>    Juergen
> 
> 


Regards,
Vincent

----------------------------------------------
     ___	      __________      ___
    /__/\            /__________\    |\ _\
    \::\'\          //::::::::::\\   |'|::|
     \::\'\        //:::_::::_:::\\  |'|::|
      \::\'\      //::/  |::|  \::\\ |'|::|
       \::\'\    //::/   |::|   \::\\|'|::|
        \::\'\__//::/    |::|    \::\|'|::|
         \::\','/::/     |::|     \::\\|::|
          \::\_/::/      |::|      \::\|::|
           \::,::/       |::|       \:::::|
            \___/        |__|        \____|

 	                 .``.
		         ',,'

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu