[clean-list] Queries for introduction to Clean's language and environment

Bas Lijnse b.lijnse at cs.ru.nl
Mon Apr 4 09:31:47 MEST 2011


Hi Mikael,

first of all, apologies for the late reply, but your list of questions
is somewhat overwhelming :)
I'll have a shot at answering them and maybe others will correct me/add
to the discussion.

On 25-03-11 22:18, Mikael wrote:
> *Documentation, community
> * * What tutorials to Clean's language & environment are you aware of
> today?
There are some online books available. You can find an overview on
http://wiki.clean.cs.ru.nl/Documentation
>  * Are there other forums for Clean programming than this emailing
> list - any IRC channel, annual symposium or alike?
Work on Clean is presented in the common functional programming
scientific conferences (ICFP,IFL,TFP etc).
There is no irc channel, the wiki can be considered a forum, but most
edits are from Clean developers atm.
>
> *Live coding, debugging*
>  * Is there anything like a REPL / live code environment? I understood
> Hilde should do this, where do I find its executable? Does it have any
> particular limitations?
Clean has no live interpreter. Hilde is an interactive shell that let's
you define and evaluate clean expressions. So it is very close to an
interactive code environment. I don't know the details exactly.
You can find Hilde in the Libraries folder of the Clean 2.2
distribution. (It was removed in the 2.3 distribution because it is no
longer maintained)
>  * What debugging features are there? Can I get a complete stack &
> environment trace/dump on errors?
You can get a stack trace, you can do heap and time profiling, and there
are trace functions.
>
> *Performance
> * * The Clean vs. GHC benchmarks I've seen are not so clear about
> what's what. What is your understanding of Clean's current performance
> in relation with that of other environments such as GHC and C code?
>      The numbers I'm interested in is when all involved environments
> have high optimization levels enabled, but still technically are
> high-level languages i.e. heap&stack overflow checking is on, that
> kind of thing.
I don't know the details on this, maybe John van Groningen can enlighten
you. My understanding is that performance is still better than GHC and
depending on the type of problem comparable to C code.
>  * Which algorithm does the GC run on?
There's multiple implemented as options, but I think the default is
mark&sweep.
>
> *Exceptions
> * * How developed is the exception handling today, can Clean code
> catch any exception such as IO or heap overflow exceptions?
There is an extension, but it is not part of the language itself.
>
> *C/C++ integration*
>  * What level of integration / Foreign Function Interface is there
> from Clean to the C or C++ worlds?
>      * Can you inline C or C++ code in your Clean code - if so how?
No, you have to compile C code separately and then call them from Clean.
>      * Can you import and call external (i.e. C) procedures and call
> them - if so how?
Yes, you can make "ccall" functions that call external procedures. It is
documented somewhat in the "calling c from clean" document that you can
find in the Help menu of the clean IDE.
>      * What data types can I pass from Clean to the C world, and back?
Basically anything you have in C. Structs are a bit messy though, since
there is no parsing of .h files you have to represent C-structs in Clean
as arrays (Int, or Char) and use offsets to dereference their fields.
You can also opt to do the struct->array conversion in an interface
layer in C.
>
> *License*
>  * Is the licensing LGPL or commercial also today? Furthermore:
I think the license is still the same.
>     * Does this mean a commercial application can use Clean as long as
> the runtime library link file is not statically linked into the app?
> Or would you allow statically linked apps also?
I think static linking is also allowed.
>     * Is there any intent to release Clean's environment as BSD or MIT
> i.e. a completely open-sourced license?
I would be in favor. I am not sure what the plans are.
>  * Is the Clean developers team open to open source contributions to
> the codebase?
Yes, but we are not really organized as an open source organization. So
patches may take a while to get through quickly and we don't always have
time to respond to questions fast. We have recently moved all sources to
svn though, to make it easier to enable external contributions.
>
> *Unicode support*
>  * What level of Unicode support does Clean have?
None natively.
>    * For instance, are characters 32bit / can they be?
Chars are just 8-bit. However we have a Text library that defines all
string operations overloaded. So it is possible to use different
encodings. The console IO functions are not unicode though.
>    * Is this support all-pervasive throughout Clean?
This approach is at the library level, so in that sense yes :)
>
> *Bytecode format*
>  * Is there any documentation of the VM/bytecode intermediary format
> when compiling Clean to C? Where's the closest thing to documentation
> out there?
There is info in the book "Functional Programming and Parallel Graph
Rewriting". Clean is not compiled to C by the way. It is compile to the
intermediate ABC instructions from which Intel assembly is generated
directly.
>      * Has there been any initiative to compile this format to any
> other language than C?
Not that I am aware of.
>      * Would you think it would be a good idea to use the bytecode for
> other things than C code generation?
I am not sure, I gues not.
>
> *Multiprocessing*
>  * Does Clean of today always run in one and the same OS process & one
> and the same OS thread? Can it use more? I read on the ML that someone
> made a parallel variant for m68k:s.
Today Clean is single threaded. Clean used to be used for parallel
processing research, but that was before the days of the multicores.
>  * Is there any green threading system?
Not that I know of.
>
> *Portability
> * * Is Clean completely locked to Windows and Linux, or can all
> non-GUI-parts be fully utilized on all other supporting systems such
> as Mac OS X, BSD and IPhones?
It is not locked to Windows and Linux per se. Platform availability is
mostly a matter of manpower. There is an alpha version of a Mac OS X
compiler being tested currently. BSD would not be problem. Iphones are a
bit more difficult because they would require a code generator for t
>  * Is the Dynamics feature and the Hilde shell only available on
> Windows also today, if so how come?
Unfortunately yes. Again a matter of manpower. Although, dynamics on
linux/osx are on top of the wishlist.
>  * Can Clean be satisfactorily used from the console (to compile, run
> apps, live interaction, other activities)?
>
In my opinion yes. Console I/O is enough to make servers or CGI apps.
Since I am doing mostlty web apps, the console is all I need.
> *IO*
>  * Can a Clean app do IO asynchronously, if so how, does the
> functionality fall back on a central event loop based on select()?
Yes. I don't know the mechanism used by the Object I/O library. If you
do it yourself, you have to do a select based loop.
>  * What level of IO performance would you say that Clean has?
I don't know.
>
> *Runtime environment
> * * Which are the runtime environment files that are dynamically used
> by a Clean-generated executable, what directory can i find them? (on
> Windows/Linux)
Normally the runtime system is statically linked into your executable
and there are no additional runtime files needed.
>  * What's the lower and upper intervals for how much space the runtime
> dependency files can take for an app? (Hello world and up to max
> complexity)
I can't answer this question.
>
> *Memory use*
>  * Do you view Clean as completely safe for 'space leaks' (given that
> the programmer was somehow present while coding)?
Yes. In normal programs (low level drivers etc excluded) you don't have
to do any memory management at all.
>
> *Robustness
> * * Would you say that Clean's environment is robust by industry
> standards i.e. a non-GUI app would not crash because of Clean bugs ever?
Clean bugs in the core system are very rare. I do get compiler bugs
every now and then, but they usually just make the compiler crash :) not
yield incorrect executables.
>  * What real-world/production apps are you aware of that Clean has
> been/is used in?
I don't know any real production apps written in Clean that were made
recently.
>
> *Completeness, development*
>  * By your own standards, how complete is Clean's language
> specification and environment?
By my standards, the language specification is pretty much complete. In
terms of standard libraries it is very incomplete. It would help a lot
if there were more libraries. I am personally trying to improve this by
collecting/developing a set of libraries in the Clean Platform project
(http://wiki.clean.cs.ru.nl/Clean_platform)
>  * How final is the language specification, could incompatibility with
> newer versions of Clean happen for current code?
The language is still evolving, but backwards compatibility is
maintained whenever possible.
>  * Approx what development takes place on Clean today? What are the
> current development objectives? What maintenance can you expect the
> next years or so?

Clean development is currently mostly focused on supporting the research
projects in Nijmegen. There is development on improving the dynamics and
generics systems. There is a lot of energy put in the itasks system
(itasks.cs.ru.nl) which results in a focus on Web related libraries for
Clean. Also the Mac port is being worked on as well as integration with
Haskell.


I have done my best to answer my questions, so I think it is only fair
to ask one in return ;)
Where did you look for this information before turning to the
mailinglist? Maybe I can put more of this info on the wiki and add links
in the right places, so you could have found it online.

Best,
Bas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/clean-list/attachments/20110404/059770c6/attachment-0001.html>


More information about the clean-list mailing list