Re: [NTLK] Newton Book or Newton Paperback, which is better

From: Paul Guyot (pguyot_at_kallisys.net)
Date: Thu Apr 22 2004 - 08:45:21 PDT


Aux environs du 22/04/04 à 15:10 +0200, sous le titre "Re: [NTLK]
Newton Book or Newton Paperback, which is be", Hendrik Lipka prit sa
plus belle plume pour écrire les mots suivants:
>For me its simple: I'm 95% Windows, and the other 5% are spent with a SSH
>on a Linux server. And as DCL is still only Mac+Linux, I'm out :(

It's just a matter of compilation.
Everything in the DCL should compile on any platform with a decent
C++ compiler. Even C99 is not required.

The platform specific parts are:
Threads (implementation of IDCLThreads)
Files (implementation of IDCLFiles)
Communication Layers (subclasses of TDCLCommLayer and TDCLSyncCommLayer).

The DCL can be ported by writing only 7 classes:
- a class for directories
- a class for roots (roots are root directories for browsing)
- a class for files
- a class for the files interface
- a class for the threads interface
- a class for a communication layer

For example, the POSIX code is about 5000 lines and with that you get
TCP/IP, Serial and Browsing on Linux, FreeBSD, etc. And the TCP/IP
code is 1500+ lines of these 5000, i.e. everything we provide on
Linux except TCP/IP is brought by only 3500 platform specific lines
of C++. And I count comments.

Porting the DCL on Windows probably wouldn't require much more.

I did kill the Win32 target of the CodeWarrior project but I'm
positive that if I resurrected it, every cross-platform bit would
compile, i.e. everything but the aforementioned implementation for
MacOS X/MacOS/POSIX that were not included in this target anyway.

>That's why Im prefer programming in Java - you get cross-platform out of
>the box (OK, except for the installers on MacOS X :(.

JNI bindings could be possible with the DCL.

You could easily provide bindings for Package and NS Objects. You
would then catch exceptions and translate them to Java exceptions
(the DCL exception model is very Java-like). You would use the memory
stream directly (Package class doesn't need real files).

Bindings for links and servers would be more tricky because both
links and servers rely on threads and JNI and native threads aren't
very good friends. However, DCL threads do not even have to be
preemptive so it's very probably possible nevertheless.

Paul

-- 
Philosophie de baignoire - consultations sur rendez-vous.
NPDS/NewtonOS: http://newton.kallisys.net:8080/
Apache/FreeBSD: http://www.kallisys.com/
-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
Official Newton FAQ: http://www.chuma.org/newton/faq/
WikiWikiNewt for all kinds of articles: http://tools.unna.org/wikiwikinewt/


This archive was generated by hypermail 2.1.5 : Thu Apr 22 2004 - 09:30:02 PDT