Re: simple compiler to CLI (.NET) ilasm

From: Alex Mizrahi (udodenko_at_hotmail.com)
Date: 01/14/05


Date: Fri, 14 Jan 2005 23:39:06 +0200


(message (Hello 'Ivan)
(you :wrote :to '("Alex Mizrahi") :on '(Fri, 14 Jan 2005 17:24:26 +0600))
(

 ??>> i thought this might be interesting/useful to somebody..
 ??>>
 ??>> i've done small/simple compiler of somthing lisp-like into .NET ilasm.
 ??>> compiler generates ilasm ".il" files, that could be compiled with
 ??>> ilasm utility into executable file and executed.

 IB> URL?

full source was included in that message below, but if you prefer urls, here
is one:
http://indirect3d.sf.net/dotNet1.lisp
8-]

 IB> I am planning to start CL-for-.NET project.

you mean CL implementation for .NET platform?
i planned to start doing something like that too, so maybe we can cooperate
to be more efficient? ;-]

actually i don't really want to focus on doing full CL (although it may be
quite useful thing to run any standard-compilant CL application, and, for
example, integrate it in a web-page using ASP.NET technology), but do some
experiments like:

--intentional programming (source should not be a text, or at least it
should be possible to add any meta-information at any point, transparently
for user)
--intelligent IDE - it should programmer much more than text editor with a
couple of scripts, it should be able to manipulate a program, not it's
source code. for example, one of nice features it could have - source
control (like CVS) on language-level, like versions or defuns, or even their
parts. and refactoring that works on source level - if you're going to
rename some global function, it should work only on function ignoring places
where it's used as a value, and it should ignore places where it's shadowed
by flet.
--automatic type solving - wherever possible, it should automatically deduce
types from context, and at least suggest to user that types to automatically
fill type declarations.
--profile-based type solving - compiler can generate code that collects info
about types being used, then it can present that information to user to
semi-automatically fill type declarations.
--profile-based optimizations
--intelligent DSL (domain-specific language) debugging - some meta-commands
to debugger, so DSLs can be debugged at source level, or deeper, if needed.
for example, i don't really want to see stuff like

(NIL #<function SPECIAL::EVAL-PROGN 200FD5CA> ((BLOCK #:NIL (TAGBODY
#:|begin-loop-558| # # # #:|end-loop-559| #))))

in backtrace when i debug (loop for i in '(1 2 3) do (+ i nil)), unless i'm
debugging loop macro.
it get's even worse with stuff like
(let ((il '(1 . 1)) (jl '(1 1))) (loop for i in il for j in jl collect (list
i j)))

backtrace is not very informative to tell that problems are with il..
simple solution is to make something like
(WITH-DSL-CONTEXT '(FOR I IN IL)
(WHEN (OR (ENDP #:|tail-538|)) (GO #:|end-loop-535|)))
so debugger can just report contexts like - error in "for i in il" in that
"loop" when appropriate debug level is set, but maybe there's something
better..

by the way, i'd like to look at you TypeL, but lispnik.newmail.ru isn't
responding. couldn't you place it in other place?

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
(prin1 "People, who lust for the Feel of keys on their fingertips (c)
Inity"))



Relevant Pages

  • Re: Why forth is not popular
    ... Even most people here responded they write a file, test it, exit the compiler, make changes to their code and run the beast again. ... which had a more sophisticated file system than many 21st century systems. ... Made it easy to find and remove the debugging ... I must admit that Perl has had its way, but Perl doesn't claim to be a compiler. ...
    (comp.lang.forth)
  • Re: Reading a string of unknown size
    ... and are ignored by the compiler. ... how can it be redundant? ... Have you ever tried *not* messing up a void * pointer? ... inadvertantly underallocate and you have good heap debugging facilities ...
    (comp.lang.c)
  • Re: STM32 ARM toolset advice?
    ... Mark Borgerson wrote: ... variables in the limited RAM space. ... but in a well implemented compiler ... The source level debugging code should be able to track a variable ...
    (comp.arch.embedded)
  • Re: Reading a string of unknown size
    ... Have you ever tried *not* messing up a void * pointer? ... No modern compiler fails to ... that's many hours of debugging waiting to ...
    (comp.lang.c)
  • Re: Random crashes
    ... > out what is causing a random crash? ... code ("compiler warns about ... ... - Some libraries, including standard libraries, come with debugging ... versions or you can obtain some debugging version. ...
    (comp.lang.cpp)

Loading