2014年11月21日 星期五

Jonathan Blow's Ideas About Programming Language雜記(3)-Demo






前兩個Talk之後約莫一個多月的時間,Jonathan Blow居然展示了一個新的程式語言compiler雛形,這個新語言之中實現了許多之前提到的想法,而且還真的可以Run,上圖就是用此程式語言寫的invaders。據說明年1月就會有初期版本公開釋出。這次Demo內容timeline如下。

Talk #3 Demo



5:30

import,load syntax
load用來load source file,有點像include
This compiler is self contained, IDEs are not needed.

9:00

compile in command line: jai xxx.jai         (目前副檔名是.jai,""語言XD?)
目前backend 是cl

9:40

simple operations

14:48

no implicit type conversion

15:10

function declaration
struct syntax
memory ownership
initial value
no default value now
array declaration

16:53

enum(named/unamed/typed/type infered)
out of order reference:
VALUE = MIDDLE_VALUE
MIDDLE_VALUE :=8

20:16

testproc()

21:10

new/delete

22:48

defer (GO has it too.)
defer demo

25:34

memory ownership

26:35

printf (through FFI to C)

27:10

named lambda

28:7

for n: 1..count {...}


29:29

dynamic array
(temporary)

30:30

for loops over dynamic array

32:30

character '(single qoute)
string ""(double qouted)
more "fors"

33:40

invaders demo
No sound
Using OPENGL


35:15

It's a real compiler though it output C
Output our own errors instead of C compiler error.
Rely on "cl" to do optimization.


38: 30

Custom check call(compile time)
Compile-time checking call using same syntax as run time language.

40:55

also compile to byte code in addition to output C codes (two compile target)

43:35

string type has bugs now.

44:05

More compile time execution
#run syntax
Invaders at compile time!!
Everything you can do at runtime you can do in compile time.
Load dlls when compile to bytecode.

48:10

Pasting local function to global without changing anything

49:07

#run local function at compile time
Bugs now!
#run invaders() in local scope at compile time.
How many invaders you defeated at compile time?

51:20  (MUST WATCH!!)

#assert syntax
"You are terrible, You must defeat at least 10 invaders to compile!"

53:05

More #assert cases
ASCII map format checking

58:58

Dependency and Building
Compiler knows the dependency

1:02:00

Conditional building
Preprocessor in runtime/compile-time language

1:12:01

BYTE CODES formats

1:16:40 

Linux version


(QA省略)

沒有留言: