newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: HPW on January 13, 2004, 11:05:15 PM

Title: pocket newLISP?
Post by: HPW on January 13, 2004, 11:05:15 PM
I have asked this once, but now I ran across it another time.
Quote
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/articles/AT3563056498.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?
Title:
Post by: Lutz on January 14, 2004, 08:43:10 AM
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
Title:
Post by: HPW on January 14, 2004, 12:29:23 PM
>(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.
Title:
Post by: Lutz on January 14, 2004, 02:18:27 PM
thanks for the info



Lutz
Title:
Post by: HPW on January 15, 2004, 07:16:24 AM
On my question on the pocket GCC forum I get this:
Quote
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/device/embedded/download.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.
Title:
Post by: Lutz on January 15, 2004, 12:23:34 PM
thanks, I will look into it,



Lutz
Title:
Post by: HPW on January 15, 2004, 10:55:40 PM
This seems even newer:



http://msdn.microsoft.com/library/default.asp?url=/downloads/list/pocket2003.asp
Title:
Post by: Lutz on January 16, 2004, 05:49:04 AM
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
Title:
Post by: HPW on January 16, 2004, 05:58:01 AM
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)
Title:
Post by: HPW on August 17, 2004, 02:41:01 AM
After the move to MinGW I ask again.



From http://groups.yahoo.com/group/pocketgcc/message/716


Quote
> 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.
Title:
Post by: pjot on August 17, 2004, 03:06:05 AM
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.
Title:
Post by: Lutz on August 17, 2004, 08:18:56 AM
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
Title:
Post by: HPW on August 17, 2004, 12:14:05 PM
I think Luis Carvalho use the compiler from here:



http://mamaich.kasone.com/fr_pocket.htm
Title:
Post by: HPW on August 21, 2004, 04:09:38 AM
Finaly it had happend: Pocket-newLISP



:-)


Quote
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


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


Quote
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/newlisp-8.1.0-wince.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
Title:
Post by: HPW on August 21, 2004, 04:30:58 AM
Even more stuff for pocket: TCL/TK



http://sourceforge.net/project/showfiles.php?group_id=91719



The question will be: Is their a IP-socket on WINCE to use the same interface as on WIN.
Title:
Post by: Lutz on August 21, 2004, 06:08:16 AM
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
Title:
Post by: HPW on August 21, 2004, 07:29:57 AM
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.
Title:
Post by: HPW on August 21, 2004, 11:44:16 AM
Taking a look at your changes in 8.1.4 I see that you did not make one change in nl-sock.c



#ifdef WINCE
fPtr->_file = handle;
fPtr->_flags = 0xFFFF;
#endif


Is it obsolet?

Or forgotten?
Title:
Post by: Lutz on August 21, 2004, 02:33:40 PM
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
Title:
Post by: Lutz on August 21, 2004, 02:43:17 PM
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
Title:
Post by: HPW on August 21, 2004, 11:16:45 PM
>oops, I missed this change, I put a corrected nl-sock.c in http://newlisp.org/downloads/WinCE/


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


Quote
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
Title:
Post by: Lutz on August 22, 2004, 05:48:50 AM
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
Title:
Post by: HPW on August 22, 2004, 09:57:00 AM
I reposted your post in the pocketGCC forum:



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



Waiting for Luis answer.
Title:
Post by: HPW on August 22, 2004, 11:46:04 PM
The last answers:


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


Quote
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


Quote
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.
Title:
Post by: Lutz on August 23, 2004, 08:20:37 AM
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
Title:
Post by: Lutz on August 23, 2004, 08:48:08 AM
I put a new nl-xml.c in http://newlisp.org/downloads/WinCE/ which might solve the xml-parse problem on the PPC (and Sparc). The newlisp.exe is also redone with the new nl-xml.c



Lutz
Title:
Post by: HPW on August 23, 2004, 09:31:22 AM
I have asked Luis to test the new EXE.



I have started to do some research for PPC-hardware.

Since the new VGA-based PPC are on the horizon, it

maybe worth to wait the time they get into the markets.



Luis and Alexander gave some advice about their hardware

(Dell X30 and imate Pocket).



As always get as much speed and memory as possible! ;-)

Dream-PPC: VGA/624MHZ/128MB RAM

Pocket Windows 2003 SecondEdition
Title:
Post by: HPW on August 24, 2004, 08:30:21 AM
Quote
From:  "Luis Carvalho (Kozure)" <kozure@c...>

Date:  Tue Aug 24, 2004  4:44 pm

Subject:  Re: newLISP compile possible?



Hallo,



Sorry again for the offtopic...



> Lutz get his compiler to work and after I had also problems

> with xml-parse on Solaris Sparc, he thinks that he found the problem.

> He compiles the new EXE and post all changed sources here:

>

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

>

> Can you test the new EXE with the qa file and give info about results.

> Lutz also registered your and Alexander's email to get always through

> his mail-filter.



Everything works right now. I'll tried to write to you and Lutz again,

with no success. Please tell him that qa has only minor problems:



- test-exec and test-process, simply because windows mobile does not

contain native _ls_ and _cat_.



- test-pipe, probably because pipe is not properly ported yet. Check the

compilation flag I put in nl-sock.c regarding this.



xml-parse works now.



Cheers,

K, I think spam is a big problem in Deutschland... :)



--

Life is the childhood of our immortality.

-- Goethe



--

Luis Carvalho (Kozure)

kozure at cox dot net

PGP key: A616822D


So xml-parse is working and all other problems have their explanation.



So no more experimental?



;-) Still no PPC-Hardware.



No idea with the mail-problem.

I have no personel mail-filter. (Maybe t-online does some)
Title:
Post by: Lutz on August 24, 2004, 12:15:27 PM
Thanks again to Luis. I am glad 'xml-parse' now works on both, Sparc and PPC, probably it was a byte-order problem.



I am currently working on a platform independent QA file, which also gives more diagnostics on failure and keeps on testing although a function has failed. I have got it more or less working for Win32 and Linux, but still have problems on BSD. Its mainly test routines where 'process' or 'exec' are involved, where the timing and handshaking is hard to get right.



The next qa by default will not test pipe, process, exec and udp functions but all other net-working functions (they are not tested currently).



Supplying an extra option it will also test pipe, process, exec and udp. I can test udp functions only when I have 'process' to start a second newlisp session.



I will mark the PPC version as non-experimental in the next version and document what should not be expected to work. It will also get it,s OS Id as 7 in 'sys-info'.



Lutz