Smalltalk Citrine

  • Published on

  • View

  • Download


CITRINE85th Smalltalk Study MeetingCITRINE PROGRAMMING LANGUAGE85 Smalltalk 2016-02-15TAKANO Mitsuhiro a.k.a. @takano32SORABITO Inc. / jus / CONBUCitrine Citrine Citrine Citrine Smalltalk SELF-INTRODUCTION TAKANO Mitsuhiro@takano32SORABITOUNIXCONBUSmalltalk DeveloperRuby committerIA-64 Citrine committer NEW Smalltalk VMWeb CITRINEProgramming LanguageABOUT CITRINECitrine CITRINE on the Web Citrine is an easy-to-learn general purpose programming language for UNIX-like operating systems. The Citrine Programming Language focuses on simplicity and emphasizes maintainability through readability. Simplicity is achieved by syntactical and conceptual minimalism.Citrine UNIX OSCitrine FEATURES OF CITRINECitrine CITRINE SmalltalkDSL API AST NilBooleanNumberStringBlock Object Object new NilPen World (Nil = Nil) ifTrue: {\ Pen write: 'Nil is Nil!'.}.Nil is Nil!(Nil isNil) ifTrue: {\ Pen write: 'Nil isNil is True!'.}.Nil isNil is True!BooleanTrue False Smalltalky `ifTrue:` True ifTrue: {\ Pen write: 'True is True'.}.True is TrueNumber5 times: {\ Pen write: 'ho'. }.hohohohohoString`trim`, `ltrim`, `rtrim` Pen write: ('title' asciiUpperCase1st).TitleBlock`{\` `{` `}` `{\` `{` `{\` `{` fizzbuzz.ctrSMALLTALK True ifTrue: {\ Pen write: 'True is True'.}.5 times: {\ Pen write: 'ho'. }.Animal := Object new.Animal on: 'eat' do: {\ Pen write: 'munch! munch!'.}.dog := Animal eat.fruits := Array PHP PHP see also PHP: - Manual `respondTo:` PHP `__invoke()` Smalltalk `#doesNotUnderstand:` DSL API echo := Object new.echo on: 'respondTo:' do: { sound |2 times: {\ Pen write: sound. }. }.echo ho!. #prints ho!ho!You can make objects respond to arbitrary messages, in some languages this is known as 'magic methods.PHP-ER AST AST Abstract Syntax TreeWikipedia abstract syntax treeASTparse treeAST AST PARSER.C PARSER.C + system.c INSIDE THE CITRINECitrine CITRINE Git GitHub CITRINE else if ctr_build_number_from_string$ git grep malloc | wc -l # => 162$ git grep free | wc -l # => 119 malloc MALLOC FREE SMALLTALK AND CITRINESmalltalk Citrine Boolean`ifTrue:` `ifFalse:` `ifTrue:ifFalse:` `ifFalse:ifTrue:` boolean.ctr Smalltalk CONCLUSIONCITRINE Smalltalk PHP Perl PHP-er C YOU FOR LISTENINGSORABITO RubyUNIXCONBUWeb GitHub:Enterprise SORABITO 2Web Smalltalk 25 eject MacBook