pocket newLISP?

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

pocket newLISP?

Post by HPW »

I have asked this once, but now I ran across it another time.
You know, there are several other programming/scripting languages ported/created for the Windows CE platform -- PocketC, Perl, Python, nScript, and so on.
from this interview:
http://www.windowsfordevices.com/articl ... 56498.html

Home of Pocket GCC:
http://mifki.ru/pocketgcc/

TCL port for Pocket PC:
http://mini.net/tcl/2946
ftp://ftp.tcl.tk/pub/incoming/tcltk844ce-arm.zip

So when I see all this interesting information, I come to the question if it is possible to get newLISP running on pocket PC.

I think newLISP would fit in there very good, because of it's size and performance.

Is it only a dream or possible future?
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

The only CE device I have, is from the late nineties with WinCE 1.0. At that time I tried to port newLISP to it, but ran in too much problems: how the memory was segmented in WinCE and a lot of functions (mainly I/O stuff) would not work on CE but would have to be recoded. The CE OS (at least at that time) did not have the usual filesystem but some other data and app storage facility.

The following questions:

(1) I would guess/hope that all these issues are different today?

(2) Are there free compile, debug and emulator tools available? I see a link to gcc, how about emulators? don't want to buy a CE.

(3) Is there other software on the CE, like GUI building stuff (i.e. Visual Basic), which could take advantage of a newLSIP DLL?

I also thought some (time ago) of porting to PALM-OS, there are free tools available (somewhat clumsy once back in 1999), and I reserved a 4-letter Id 'NLSP' with PALM at that time, which was required to host apps on the PALM. The PALM OS had similar issues with Memory and app/data storage as the CE has (but easier to use than CE's), and I abondoned it. Else I like the PALM-OS and use PALM as my PDA since it came out.

There is also a variety of LINUX PDA's, but I am not current, whats avalable now. On these PDA devices ia port should be the easiest.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

>(1) I would guess/hope that all these issues are different today?

I hope the same! But I have not more knowledge than you on this.

>(2) Are there free compile, debug and emulator tools available? I see a link to gcc, how about emulators? don't want to buy a CE.

The only emulator I know of is the Visual Studio 2003 emulator. But as I said my knowledge is limited. I thought the GCC would be the basis which is needed to port to this device.

>(3) Is there other software on the CE, like GUI building stuff (i.e. Visual Basic), which could take advantage of a newLSIP DLL?

I posted the TCL/TK link to the port of TK. When it run on pockket PC you have the GUI like you use it under windows.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

thanks for the info

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

On my question on the pocket GCC forum I get this:
I suggest that you just compile newlisp with the embedded Visual C++
development system from Microsoft which can be downloaded here:

http://msdn.microsoft.com/vstudio/devic ... nload.aspx

This fully complete (and totally free) development system is designed for
Pocket PC PDA software development.

There is also a Visual Basic compiler add-in

I have found this IDE to be as complete as the regular Development Studio.

Rgds,
Scott
from here:
http://groups.yahoo.com/group/pocketgcc/

Back to MS? Don't shure if it is worth to check.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

thanks, I will look into it,

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I looked through some of the CE stuff and decided not to do anything for now. There is just too much work involved, which is better invested for newLISP on the existing platforms or other platforms than Windows CE, i.e. Apple Mac.

Any programming language one would offer on the CE device would also have to support a lot of CE specific things, like supporting the various APIs to interact with other applications and specific parts of the CE system, comunications APIs like OBEX and Bluetooth etc.. If you don't do this, you just created another cute little toy, but with not much real potential to do useful applications for the CE with it.

At the moment newLISP has just not enough users justify putting so much work into a CE port. I rather concentrate on improving newLISP on the exisiting platforms. By the end of the year I want to buy an Apple Mac System and perhaps revisit the whole area of building GUIs with newLISP.

At the moment I want to concentrate on newLISP as a scripting language in a platform independent web environment, and perhaps build some more packages to import other libraries, inteface to other applications etc.


Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Lutz,

Thanks for the clear answer.
I can understand all your points and agree with them.
I had asked this, because I thought on the first look that it would
be an easier task. But as more as I read about it, the more problems
become visible.

So get back to newLISP. (As I will do with my alisp project)
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

After the move to MinGW I ask again.

From http://groups.yahoo.com/group/pocketgcc/message/716
> Since newLISP 8.1 it is now compiled with GCC under windows using
> MinGW.
> http://www.mingw.org/
> It only uses MSYS.
> May be now the chance get higher to compile it under PocketGCC?
> True?

The FAQ at newLISP's site states:
"(...) newLISP has a minimum of dependencies and uses only the most
standard libraries to compile. If your system has GNU tools with the GCC
compiler and make utility, then it will probably compile and link right
away with one of the makefiles in the source distribution.

newLISP is built using hand crafted makefiles for a specific platform.
There are no complex make scripts. The makefiles are short and easy to
change and adapt if your configuration is not included already."

So, technically, yes, you should be able to compile it with PocketGCC. I
played with the sources a little bit -- adding some compilation flags --
and was able to compile an executable without a single warning through
the process. However, unfortunately, newlisp.exe crashes on my PPC,
raising an exception.

I don't have enough time to go over this, but if you have any interest,
I can send you the tweaked sources for you to play with and debug. Some
minor modifications are also necessary in sys/wcetypes.h to avoid type
redefinitions (as Mamaich has already pointed out in this list before).

Cheers,
K.

--
Life is the childhood of our immortality.
-- Goethe

--
Luis Carvalho (Kozure)
kozure at cox dot net
PGP key: A616822D
Since I have not a pocket PC yet, I can not jump on it.
But I would definatly buy one, when I would get LISP running on it.
Hans-Peter

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

The link to PocketGCC does not work anymore, but I could download the package from

http://www.pocketgear.com/download.asp?product_id=11502

I own a HP Jornada 548 with WinCE 3.0, but this PDA uses a SH-3 processor. The PocketGCC package however is created for the ARM processor line. So if newLisp is going to be compiled using PocketGCC, it will be for the ARM only.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

The experiment Luis Carvalho did sounds encouraging, it may just be some trivial thing during startup, i.e. the WSAStartup(), which crashes the system or some of the exception initialization routines, or the wrong specifications when linking.

But the fact that he could compile and link without warnings is very encouraging . A couple of 'printf' in the right place of the code should reveal the source of the problem.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I think Luis Carvalho use the compiler from here:

http://mamaich.kasone.com/fr_pocket.htm
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Finaly it had happend: Pocket-newLISP

:-)
Hallo,

>>The experiment Luis Carvalho did sounds encouraging, it may just be
>>some trivial thing during startup, i.e. the WSAStartup(), which
>>crashes the system or some of the exception initialization routines,
>>or the wrong specifications when linking.
>
>>But the fact that he could compile and link without warnings is very
>>encouraging . A couple of 'printf' in the right place of the code
>>should reveal the source of the problem.

I went over the code again, nailing a few printf's as Lutz suggested.
There are some very weird things going on: argc and argv point to
garbage, and IOchannel (a FILE pointer setted to stdin) raises the
exception when called. I don't know why is that so, and worse, how to
solve or even work around it.

Cheers,
K, sorry for the bad news.

--
Life is the childhood of our immortality.
-- Goethe

--
Luis Carvalho (Kozure)
kozure at cox dot net
PGP key: A616822D
From: "Alexander M." <mamaich@u...>
Date: Fri Aug 20, 2004 1:07 am
Subject: Re: newLISP compile possible?


> I went over the code again, nailing a few printf's as Lutz suggested.
> There are some very weird things going on: argc and argv point to
> garbage, and IOchannel (a FILE pointer setted to stdin) raises the
> exception when called. I don't know why is that so, and worse, how to
> solve or even work around it.

I know this bug. Try to add a "-staticlibs" compiler option. There is
a problem in linker, that when using libc.dll (dynamic C runtime, it
is used by default) and linking with some Microsoft LIB files all data
imports from LIBC are invalid. I.e. argc, argv, stdin, environ and
alike cause GPF when accessed. The other workaround is to recreate
these import libraries with GNU tools. The known libraries that cause
this problem are AYGSHELL.LIB, TOOLHELP.LIB, probably other LIBs that
use import by ordinal.
I'm trying to fix this.
From: "Luis Carvalho (Kozure)" <kozure@c...>
Date: Fri Aug 20, 2004 2:02 am
Subject: Re: [pocketgcc] Re: newLISP compile possible?


ADVERTISEMENT


Hallo,

> I know this bug. Try to add a "-staticlibs" compiler option. There is
> a problem in linker, that when using libc.dll (dynamic C runtime, it
> is used by default) and linking with some Microsoft LIB files all data
> imports from LIBC are invalid. I.e. argc, argv, stdin, environ and
> alike cause GPF when accessed. The other workaround is to recreate
> these import libraries with GNU tools. The known libraries that cause
> this problem are AYGSHELL.LIB, TOOLHELP.LIB, probably other LIBs that
> use import by ordinal.
> I'm trying to fix this.

Mamaich went right on to the spot! So, Hans-Peter, you now have newLISP
on Pocket PC:

ftp://ftp.saci.homeip.net/pub/wince/newlisp.exe

The sources are a little bit tweaked, but I'm sure they can be made
cleaner (and clearer). As I promised, here are the modified sources:

ftp://ftp.saci.homeip.net/pub/wince/new ... nce.tar.gz

A simple diff on the main dir should reveal the changes. I also added a
makefile_wince.

Cheers,
K, now you can have a PPC.

--
Life is the childhood of our immortality.
-- Goethe

--
Luis Carvalho (Kozure)
kozure at cox dot net
PGP key: A616822D
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Even more stuff for pocket: TCL/TK

http://sourceforge.net/project/showfile ... p_id=91719

The question will be: Is their a IP-socket on WINCE to use the same interface as on WIN.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Great work by Luis Carvalho to make this work thanks to Alexander Mamaich for his help and thanks to you Hans-Peter for initiating this.

Changes are small enough to incorporate them into the next release. I do not own a pocketpc but perhaps with Luis and Hans-Peter pending issues (if they surface) can be worked out.

Where can I contact Luis Luis and Alexander to thank them and discuss a couple of questions about the pocket PC platform?

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Hello Lutz,

Thanks for the plan to integrate the changes.

Luis: kozure at cox dot net

Alexander: mamaich at uymail dot com

I hope to get some hardware soon. Maybe I can get one from a co-worker in the office to start.
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Taking a look at your changes in 8.1.4 I see that you did not make one change in nl-sock.c

Code: Select all

#ifdef WINCE
fPtr->_file = handle;
fPtr->_flags = 0xFFFF;
#endif
Is it obsolet?
Or forgotten?
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

oops, I missed this change, I put a corrected nl-sock.c in http://newlisp.org/downloads/WinCE/

If anybody want to compile it, I can put an executable in the same directory.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

There is some simplifying, I want to do in the #define/#ifdef parts for MinGW/Borland/PocketPC. It's all a bit messy, but I need to install the tools and need somebody to test.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

>oops, I missed this change, I put a corrected nl-sock.c in http://newlisp.org/downloads/WinCE/
> Taking a look/diff at Lutz changes in 8.1.4 I see that he did not
> make one change in nl-sock.c
>
> code:
>
> #ifdef WINCE
> fPtr->_file = handle;
> fPtr->_flags = 0xFFFF;
> #endif
>
> If it is needed you should add it again.

I was just testing something and ended up forgetting to cut this piece
of code off. Happy to know that Lutz did it.

Cheers,
K, thanks for the advice though.

--
Life is the childhood of our immortality.
-- Goethe

--
Luis Carvalho (Kozure)
kozure at cox dot net
PGP key: A616822D
So the change seems to be obsolet.

>It's all a bit messy, but I need to install the tools and need somebody to test.

I have asked Luis to make a new compile and test.
From: "Luis Carvalho (Kozure)" <kozure@c...>
Date: Sat Aug 21, 2004 11:47 pm
Subject: Re: [pocketgcc] Re: newLISP compile possible?


ADVERTISEMENT


Hallo,

<snip>
> (What the best pocket-hardware for PGCC? Any recomodations?)

I use Dell Axim X30, and I'm very happy with it.

> Do I need something different than your source-package?

No, you just need newLISP > 8.1.4. I tested it and it compiled
out-of-the-box with Mamaich's PocketGCC.

> What must I install from Mamaich?

http://mamaich.kasone.com/ppc/arm-wince-pe.rar

Go to his page for further details on installation. You'll also need
Cygwin (on your computer) and PocketConsole (on your to-be PPC).

> How can I get the best start with PocketGCC?

Hack newLISP to squash bugs.

> Thanks a lot again!

Bitte.

Cheers,
K, and watch for off-topics.

--
Life is the childhood of our immortality.
-- Goethe

--
Luis Carvalho (Kozure)
kozure at cox dot net
PGP key: A616822D
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I got http://mamaich.kasone.com/ppc/arm-wince-pe.rar and installed in under my CYGWIN installation in /usr/local like recommended in Maimach's readme file, but I had to do several changes how to include files to make it compile without a warnings.

But I still canot link:
-------------------------------------------------------------------------------
arm-wince-pe-gcc -staticlibs newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import
l.o nl-web.o nl-matrix.o nl-debug.o pcre.o win32-util.o -o newlisp.exe
o(.text+0x0):newlisp.c: multiple definition of `main'
al/lib/gcc-lib/arm-wince-pe/3.3.3/../../../../arm-wince-pe/lib/crt0.o(.text+0x2c): first defined here
al/lib/gcc-lib/arm-wince-pe/3.3.3/../../../../arm-wince-pe/lib/crt0.o(.text+0x6c): undefined reference to `WinMain'
: ld returned 1 exit status
*** [default] Error 1
Leaving directory `/home/Lutz/newlisp-8.1.5'
* [wince] Error 2
--------------------------------------------------------------------------------

it is complaining, that 'main' is already defined and that 'WinMain' is not defined.

Is Luis perhaps using an older arm-wince-pe.rar ? My compile is behaving very differently.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I reposted your post in the pocketGCC forum:

http://groups.yahoo.com/group/pocketgcc/

Waiting for Luis answer.
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

The last answers:
From: "Alexander M." <mamaich@u...>
Date: Mon Aug 23, 2004 12:49 am
Subject: Re: newLISP compile possible?

>
> it is complaining, that 'main' is already defined and that 'WinMain'
> is not definded.

To fix this you may add "-target=win" or "-target=con" GCC command
line parameter. Or you can install update
http://mamaich.kasone.com/ppc/specs.rar, it tries to guess the program
entry point.
From: "Luis Carvalho (Kozure)" <kozure@c...>
Date: Mon Aug 23, 2004 1:52 am
Subject: Re: [pocketgcc] Re: newLISP compile possible?

Hallo,

> Is Luis perhaps using an older arm-wince-pe.rar ? My compile is
> behaving very differently.

I think I used the last version, but applied all patches provided by
Mamaich, i.e. {libcfix, libcfix1, specs}.rar. Also, I had to comment out
some definitions on sys/wcetypes.h to avoid redefinition errors, like
HMODULE and HINSTANCE.

Sorry for the offtopic guys...
<offtopic>
I tested the last version of newLISP, including the qa file, and
everything was almost perfect, with the exception of xml-parse that
raised an exception and crashed newlisp. I tried to write to Lutz, but
the mail keeps bouncing back. Can I forward it to you so that you can
pass it to Lutz?
</offtopic>

Asko, I'll test LuaX as soon as I have time. I'm still trying to develop
a numerical package for Lua (that I'll try to port to wince if I get g77
to work), and I'll give LuaX a chance as soon as I'm finished.

Mamaich, I agree with you on the PPC specs. But, hey, I'm a cheap guy. :)

Cheers,
K, and a slow starter.

--
Life is the childhood of our immortality.
-- Goethe

--
Luis Carvalho (Kozure)
kozure at cox dot net
PGP key: A616822D
From: "Alexander M." <mamaich@u...>
Date: Mon Aug 23, 2004 8:18 am
Subject: G77 binaries. (Re: newLISP compile possible?)

> Asko, I'll test LuaX as soon as I have time. I'm still trying to
develop
> a numerical package for Lua (that I'll try to port to wince if I get
g77
> to work), and I'll give LuaX a chance as soon as I'm finished.

I've uploaded a compiled Cygwin version of G77 compiler and other
tools. Compiler is probably working.
http://mamaich.kasone.com/g77_objc.rar 6,249,571 bytes.
Archive contains all GNU compilers I was able to build and all
libraries I have. It also has an updated static libc.a with a test
implementation of fork() function, though it is still unfinished.

To install - decompress it to your /usr/ directory (archuive already
contains "local" subdirectory. It would overwrite some of your files,
so do the backup.

To compile ObjectiveC program:
gcc test.m -lobjc

To compile G77 program you should edit "specs" file and remove
"-include fixincl.h" from it (F771 does not support this switch), then
run it as following:
gcc hello.f -lfrtbegin -lg2c -target=con
You have to specify "-target=con" when main() function is located
inside library (this is true for G77). In such case compiler cannot
guess the correct target.
The archive already contains a modified "specs" file. If you use it,
then when you compile normal C/C++ programs you have to add " -include
fixincl.h" to the end of every GCC command line.
Later I'll modify G77 sources so that it would ignore "-include"
command line.

Archive contains 2 examples.
It also contains a Java compiler and an updated GDB debugger. I have
not tested them.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks Hans-Peter, Luis and Alexander, how strange that the email to me bounced, I have had no problems receiving email otherwise. Again my address is: lutz at nuevatec dot com and the word 'newlisp' or 'consulting' must be included in the subject line, unless I have registered your email addresses, which I did for Hans-Peter, Luis and Alexander).

The '-target=con' option did the job, thanks. I can make a clean compile/link now with the latest (August 22, 2004) arm-wince-pe.rar and un-patched.

I have put changed files and a compiled executable for the ARM PPC in:

http://newlisp.org/downloads/WinCE/

Remember I can *not* test the executable, as I don't have a PPC.

Lutz

PS: net work functions are not tested in the current qa

Locked