On May 8, 8:57 pm, 3Jane <
1...@depikt.net> wrote:
> Okay - thanks !
>
> "aggressive work" is sounding well and gives me hope
> that we can see a nice version this summer. All in
> all the project looks great. There is no really living
> dataflow language today - stating this i found ani.
>
> And i like the grammar (including the backslash).
> Code and the tutorial are very short in regard of
> the expressive power of the language - apparently
> not only easy matter has left being easy, some
> difficult matter has been made loooking easy too.
It's good to know the simplicity of the language is appreciated.
Personally, I think that too many languages try to have their code
"read like english" and fail because the semantics of the language are
so complicated that the analogy to reading natural language actually
ends up interfering with understanding: an excellent example here is C+
+, which (ironically) the compiler is written in. Python does a much
better job, but when you get into the more advanced Python
programming, you still have to refer to the manual from time to time
(at least I do).
That's why ANI's syntax has no built-in keywords (although there is a
standard namespace for the primitive object types and such).
Everything is defined using consistent nested punctuation, which
allows the user to define arbitrary data structures and algorithms
without the language syntax getting in the way; this is unlike C++,
which is pretty strict about crazy and confusing things like ambiguous
overloads, class hierarchies, virtual-ness of methods, etc. and forces
you to fight with the language and compiler to get your point across
far more than necessary.
>
> For me it is obvious, that a lot of thought and
> decision finding have gone into this - so i hesitate
> to offer help. What i'd definitely like to do were
> to write some parts of the planned standard lib.
> There are enough simple tasks for learning
> ani in the same move (obviously Python's
> standard lib has been developed by newbie
> coders with the same idea. Python's quality
> is still suffering from that and ani should avoid
> this failure. A real open culture of debate -
> open also to so-called "non-constructive"
> critics - would be useful).
Yeah, that's something to look out for. But for the time being, I'm
willing to personally review all of the ANI standard lib code that
people write to check for bugs and poor quality code. And I completely
agree that we should be fully open to criticism of code; compilers and
libraries are almost by definition used by a *lot* of different people
and therefore their design and implementation should seek as many
diverse opinions as possible.
>
> Not so simple are utf-8 and utf-16. These
> are crucial - a language without unicode
> support has no chance finding users at all today.
> The nontrivial problem is index subscription.
>
> Also crucial seems to me a powerful engine of
> string methods including find, index, split,
> rsplit, lsplit, trim, rtrim, ltrim, join, startswith,
> endswith, replace, regex.replace and more.
> Having this index subscription is needed
> surprisingly seldom - but it stays needed.
>
> There is no alternative to counting the
> occurrences of bytes >= 0xC0 (for utf-8),
> thus the complexity of .[n] is unavoidably>= O(n). But one could reason about a way
>
> of cashing the results of such counting ...
Yeah, UTF is going to be non-trivial. However, keep in mind that with
well-written ANI code, the compiler could probably get it down to O(n/
c) time, where c is the number of processors you have available.
Counting byte matches is something that anic can easily make parallel,
even if you implement it in the naive way of filtering a character
stream, byte-by-byte.
>
> But work on a (more or less canonical)
> standard lib would be much easier with
> a working compiler. Moreover, i do not
> find any import- or include-mechanism
> in the tutorial (my preference were include
> with header files, a personal note beside:
> Using gcc, not Visual Studio, on Windows
> is no more any issue of costs or moral -
> i really do like gcc and mingw).
There is an import-type mechanism in ANI already. I'm not sure if it's
mentioned in the Tutorial, but basically it look like this:
@someLib.someObject; // @ is the import operator
/* blah blah */ someObject /* blah blah */;
Essentially, the @ operator finds an identifier in some other
namespace and puts it into the current one, which allows you to import
basically anything into where you want it. This means that someLib
needs to be defined somewhere in the source. If it's defined in the
same file as the import declaration, everything will work perfectly
fine. If someLib is defined in another file, that's fine too, but in
that case, the file that contains the definition of someLib needs to
be in the list of files to compile given to anic on the command line,
or anic will complain that it doesn't know how to bind the reference
to someLib.someObject (which makes sense - anic can't go looking
around the filesystem for extra source files to use). Of course, the
standard libraries do not need to be listed on the command line: the
compiler automatically knows about them.
There is currently no way to currently "include" files into ANI
source, but I don't see much need for this. #include just invites
confusion, complexity, and bugs... and if you have #include, then you
need #ifdef include guards to protect against recursive include, and
then you have exactly the same mess that you have with C.
>
> Having <include> or <import> another
> question arises: How to interface with
> C-code. Providing this must come
> before any standard lib. Is there really
> anybody out there, who wants to translate
> the 100.000 lines of sqlite source-code ?
> And maintain this translation in the
> sequel ?
>
> And a decision is needed here before:
>
> Do you want to have a C-interface or
> an interface to machine code in shared libs
> first (a living language will come to support
> for both sooner or later - but that is future) ?
>
> Good luck, Joost
C code interfaces are planned, and will probably be implemented in the
language as a way to declare ANI filters without defining them. This
will cause anic to give these filters gcc-linkable labels in the
assembler output, allowing you to link the ANI code with external C
functions that have the same signature.
However, I don't want to encourage this too much because this presents
a whole bunch of problems for ANI code: pretty much everything in ANI
runs in parallel, and the external C functions would need to be
written with that in mind - i.e. it's the programmer's job to make
sure that no concurrent data access problems like deadlock or race
conditions arise in the interfaced code.
If it's just ANI code, anic can make sure that everything is safe,
efficient, and conflict-free. But if you call arbitrary C code, making
sure that you're not stomping on internal ANI data structures while
they are being accessed by another thread is completely up to you, and
anic can't really help you. And I can't even imagine the problems that
would arise if the C code does something crazy like fork() or spawn a
new thread that the ANI runtime doesn't know about, or if the function
call is really long and holds up ANI's real-time context switching.
I realize that we *do* want to reuse the C code that's out there, but
the nature of ANI programs means that the C code would need to be
specially rewritten with ANI in mind if things are going to work
properly.
It's good that you're bringing these issues up, though. It's best to
think about them sooner rather than later.
Adrian