This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# asm.rb | |
def hello(name) | |
Rubinius.asm(name) do |name| | |
push :self | |
run name | |
string_dup | |
push_literal "hello, " | |
string_dup | |
string_append | |
send :p, 1, true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def map: block { | |
"Returns a new @Array@ with the results of calling a given block for every element" | |
coll = [] | |
each: |x| { | |
if: (block argcount == 0) then: { | |
coll << (block call_with_receiver: x) # <- had to add this part.. | |
} else: { | |
coll << (block call: [x]) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot = FancyIRC Client new: { | |
configuration: { | |
nickname: "fancy_irc" | |
server: "irc.freenode.net" | |
port: 6667 | |
channels: ["#fancy"] | |
} | |
on: 'channel pattern: /^hello/ do: |msg| { | |
msg reply: $ "Hello to you too, " ++ (msg author) ++ "?" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bakkdoor:~/projekte/fancy/fancy-lang[master*]> diff boot/.wootstrap/compiler/ast/message_send.fyc boot/compiler/compiler/ast/message_send.fyc | |
846c846 | |
< 27 | |
--- | |
> 29 | |
883a884,887 | |
> 29 | |
> I | |
> e | |
> I |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Rakefile b/Rakefile | |
index 2fd6050..c94ec50 100644 | |
--- a/Rakefile | |
+++ b/Rakefile | |
@@ -81,13 +81,19 @@ namespace :compiler do | |
cmd << "--" | |
cmd << "--batch" if RakeFileUtils.verbose_flag == true | |
- source_dirs = ["lib", "lib/parser", "lib/compiler", "lib/compiler/ast", | |
- "lib/rbx", "lib/package", "boot"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bakkdoor@bakkdoor-thinkpad:~/Desktop$ rvm use rbx-head | |
Using /home/bakkdoor/.rvm/gems/rbx-head | |
bakkdoor@bakkdoor-thinkpad:~/Desktop$ git clone git://github.com/bakkdoor/fancy | |
Initialized empty Git repository in /home/bakkdoor/Desktop/fancy/.git/ | |
remote: Counting objects: 12377, done. | |
remote: Compressing objects: 100% (3910/3910), done. | |
remote: Total 12377 (delta 9187), reused 11243 (delta 8350) | |
Receiving objects: 100% (12377/12377), 2.86 MiB | 1.05 MiB/s, done. | |
Resolving deltas: 100% (9187/9187), done. | |
bakkdoor@bakkdoor-thinkpad:~/Desktop$ cd fancy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bakkdoor@bakkdoor-thinkpad:~/Desktop/fancy$ rvm use rbx-head | |
Using /home/bakkdoor/.rvm/gems/rbx-head | |
bakkdoor@bakkdoor-thinkpad:~/Desktop/fancy$ | |
bakkdoor@bakkdoor-thinkpad:~/Desktop/fancy$ rake bootstrap | |
(in /home/bakkdoor/Desktop/fancy) | |
rbx /home/bakkdoor/Desktop/fancy/lib/parser/ext/extconf.rb | |
checking for main() in -lfl... yes | |
creating Makefile | |
make -C /home/bakkdoor/Desktop/fancy/lib/parser/ext | |
make: Gehe in Verzeichnis '/home/bakkdoor/Desktop/fancy/lib/parser/ext' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bakkdoor@bakkdoor-thinkpad:~/Desktop/fancy$ rake bootstrap | |
(in /home/bakkdoor/Desktop/fancy) | |
rbx /home/bakkdoor/Desktop/fancy/lib/parser/ext/extconf.rb | |
checking for main() in -lfl... yes | |
creating Makefile | |
make -C /home/bakkdoor/Desktop/fancy/lib/parser/ext | |
make: Gehe in Verzeichnis '/home/bakkdoor/Desktop/fancy/lib/parser/ext' | |
gcc -I. -I. -I/home/bakkdoor/.rvm/rubies/rbx-head/include -I/home/bakkdoor/Desktop/fancy/lib/parser/ext -fPIC -ggdb3 -O2 -fPIC -c parser.c | |
gcc -I. -I. -I/home/bakkdoor/.rvm/rubies/rbx-head/include -I/home/bakkdoor/Desktop/fancy/lib/parser/ext -fPIC -ggdb3 -O2 -fPIC -c ext.c | |
gcc -I. -I. -I/home/bakkdoor/.rvm/rubies/rbx-head/include -I/home/bakkdoor/Desktop/fancy/lib/parser/ext -fPIC -ggdb3 -O2 -fPIC -c lexer.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bakkdoor:~/Desktop/fancy[bootstrap*]> rake bootstrap -v | |
(in /home/bakkdoor/Desktop/fancy) | |
make -C /home/bakkdoor/Desktop/fancy/lib/parser/ext | |
make: Gehe in Verzeichnis '/home/bakkdoor/Desktop/fancy/lib/parser/ext' | |
gcc -I. -I. -I/home/bakkdoor/projekte/ruby/rubinius/vm/capi/include -I/home/bakkdoor/Desktop/fancy/lib/parser/ext -fPIC -ggdb3 -O2 -fPIC -c ext.c | |
gcc -I. -I. -I/home/bakkdoor/projekte/ruby/rubinius/vm/capi/include -I/home/bakkdoor/Desktop/fancy/lib/parser/ext -fPIC -ggdb3 -O2 -fPIC -c parser.c | |
gcc -I. -I. -I/home/bakkdoor/projekte/ruby/rubinius/vm/capi/include -I/home/bakkdoor/Desktop/fancy/lib/parser/ext -fPIC -ggdb3 -O2 -fPIC -c lexer.c | |
cc -shared -o fancy_parser.so ext.o parser.o lexer.o -L. -L/home/bakkdoor/projekte/ruby/rubinius/lib -lfl | |
make: Verlasse Verzeichnis '/home/bakkdoor/Desktop/fancy/lib/parser/ext' | |
mkdir -p /home/bakkdoor/Desktop/fancy/boot/compiler/parser/ext |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bakkdoor:~/Desktop/fancy[bootstrap*]> rbx /home/bakkdoor/Desktop/fancy/boot/load.rb /home/bakkdoor/Desktop/fancy/boot/compiler/boot.fyc /home/bakkdoor/Desktop/fancy/boot/compiler/compiler.fyc /home/bakkdoor/Desktop/fancy/boot/compiler/compiler/command.fyc /home/bakkdoor/Desktop/fancy/boot/compiler/compile.fyc -- lib/**/*.fy --batch | |
Compiling lib/compiler/ast.fy | |
Compiling lib/compiler/command.fy | |
Compiling lib/compiler/compiler.fy | |
Compiling lib/compiler/stages.fy | |
Compiling lib/package/dependency.fy | |
Compiling lib/package/installer.fy | |
Compiling lib/package/specification.fy | |
Compiling lib/package/uninstaller.fy | |
Compiling lib/parser/methods.fy |