links · people · groups · tags | My: links · tags · groups · watchlists · notes login · sign up now! | help · blog
Simpy simpy
 
Michael Shook, member since May 27, 2004
.
Search Everyone: "compiler",

Top "compiler" experts: broatch, tomzheng, technobite, ahy1, youallnome, brice,

1 - 3 of 3   Watch mshook
 
via
http://twitter.com/programmingjoy
Javascript as Compiler Target: Clamato, GWT Smalltalk, Python, Scheme
http://www.infoq.com/news/2009/09/javascript-compilation-target

(require moby/stub/world)

(define WIDTH 320)
(define HEIGHT 480)

(define (render w)
  (place-image 
   (text "Hello World" 10 "Black")
   20
   20
   (empty-scene WIDTH HEIGHT)))

(big-bang WIDTH HEIGHT 10 0)
(on-redraw render)

After a few minutes of poking around, I was able to compile this to Java and then run it on the Android Emulator:

by mshook 2009-10-01 16:40 scheme · android · javascript · compiler · lisp · java · mobile · example · code · interesting
http://benjisimon.blogspot.com/2009/03/plt-scheme-meets-android-platform.html - cached - mail it - history

Example: sum of first 4 integers.

sum = 0;
for (i = 1; i <= 4; ++i)
   sum += i*i;
can be translated to
sum = 0;
i = 1;
loop:
   if (i == 5) goto end;;
   sum = sum + i;
   i = i + 1;
goto loop;
end:
can be translated to
; sum in R16
; i in R17
; R18,R19 used for temporary values
    LDI R16, 0
    LDI R17, 1
    LDI R18, 5
    SUB R18, R17
    BRBS 1, 22
    ADD R16, R17
    LDI R19, 1
    ADD R17, R19
    JMP 2
    SLEEP

by mshook 2009-05-16 22:45 slides · assembler · c · compile · howto · avr · up · arduino · example · code
http://www.cse.unsw.edu.au/~cs1721/05s2/lectures/slide52.html - cached - mail it - history
"The best source for breaking this myth is Jack Crenshaw's series, Let's Write a Compiler!, which started in 1988. This is one of those gems of technical writing where what's assumed to be a complex topic ends up being suitable for a first year programming class. He focuses on compilers of the Turbo Pascal class: single pass, parsing and code generation are intermingled, and only the most basic of optimizations are applied to the resulting code. The original tutorials used Pascal as the implementation language, but there's a C version out there, too. If you're truly adventurous, Marcel Hendrix has done a Forth translation (and as Forth is an interactive language, it's easier to experiment with and understand than the C or Pascal sources). "
by mshook 2008-06-30 09:43 book · ebook · howto · compiler · parse · code · viapopular
http://prog21.dadgum.com/30.html - cached - mail it - history
1 - 3 of 3  
Related Tags
 
- exclude ~ optional + require
Add Dates