1 / 13

Tycho

Tycho. A small extensible language on .Net. Functional Object Oriented Aspect Oriented Language Oriented Extensible!. tycho.googlecode.com. Variables. > a-list := list [1, 2, 3 ] > an -integer := 56 > location := " Interzone !" > location := " Macondo !". tycho.googlecode.com.

nola
Download Presentation

Tycho

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tycho A small extensible language on .Net

  2. Functional • Object Oriented • Aspect Oriented • Language Oriented • Extensible! tycho.googlecode.com

  3. Variables > a-list := list [1, 2, 3] > an-integer := 56 > location := "Interzone!" > location := "Macondo!" tycho.googlecode.com

  4. Constants > genesis-6-13 = "And God said unto Noah..." > genesis-6-13 = "Noah, a polymath specializing in meteorology and zoology, predicted…" tycho.googlecode.com

  5. Functions > a => a + 1 > add = (a, b) => { a + b } > inspect = (a) => print a a > add (2, 4) 6 > add ("2", "4") "24" tycho.googlecode.com

  6. Objects > noah = object property name := "Noah" property role := "Concerned Citizen" > noah.name "Noah" > noah.role "Concerned Citizen" tycho.googlecode.com

  7. Methods > noah = object property name := "Noah" property role := "Concerned Citizen" method save-biosphere () => // enter code to save biosphere here. > noah.save-biosphere () tycho.googlecode.com

  8. Constructors > create-noah = () => object property name := "Noah" … > noah1 = create-noah () > noah2 = create-noah () > noah1.save-biosphere () > noah2.save-biosphere () tycho.googlecode.com

  9. Actors > simple-actor = actor (self, name, args, ...) => print name, args > simple-actor.save-biosphere () save-biosphere, list [] > simple-actor.save-biosphere ("giraffe", "elephant") save-biosphere, list ["giraffe", "elephant"] > simple-actor.name tycho:runtime:get-property, list [user:name] > simple-actor.name := "Xerces" tycho:runtime:set-property, list [user:name, "Xerces"] > simple-actor[7] Tycho:runtime:get-index, list [7] tycho.googlecode.com

  10. Schemas(or “Jelly” Typing) > rect = struct {width := 40, height := 30} > get-area = (rectangle :: {width, height}) => rectangle.width * rectangle.height > get-area = {width, height} => width * height > fibonacci = method 0 => 1 1 => 1 n > 0 => fibonacci (n – 1) + fibonacci (n – 2) tycho.googlecode.com

  11. Macros > macro increment > function-call ("++" expr) => #expr := #expr + 1 > n := 1 1 > ++n 2 tycho.googlecode.com

  12. Growing a language > macro object ("object" body) => constructor = tycho:runtime:self => #body tycho:runtime:self constructor (tycho:runtime:create-object ()) > macro actor ("actor" body) => tycho:runtime:create-actor (#body) tycho.googlecode.com

  13. More info timmacfarlane@gmail.com http://tycho.googlecode.com/

More Related