ooc A hybrid language experiment
Why? <ul><li>Software sucks </li><ul><li>It's unreliable
It's slow
It's too hard to develop
It's not modular enough
[insert rant here] </li></ul></ul>« The quality of a piece of software is inversely proportional to its popularity. »   — ...
Why? <ul><li>The fate of popular software </li></ul>
Why? <ul><li>Languages suck </li></ul>void  (* signal ( int ,  void  (* fp )( int )))( int );
Why? <ul><li>Languages suck </li></ul>void  (* signal ( int ,  void  (* fp )( int )))( int ); signal :  Func ( Int ,  Func...
Why? <ul><li>Tools suck </li></ul>small.cpp(17) : error C2664: 'class std::_Tree<class std::basic_string<char,struct std::...
Why? <ul><li>Tools suck </li><ul><li>GNU autoconf, automake, autoreconf – masochism
GNU ld – the kitchen sink of linkers
GNU make – the brainless servant </li></ul><li>Bad workers blame the tool </li><ul><li>What if good workers do too?
Break with tradition </li></ul></ul>
Why? <ul><li>School assignment in C – laziness. </li><ul><li>4 months later – ooc 0.1
« Version 1 Sucks, But Ship It Anyway » – J. Atwood </li></ul></ul><ul><li>Finding a purpose </li><ul><li>To remove obstac...
To encourage experimentation
To minimize frustration </li></ul></ul>
What? <ul><li>Classes, abstract, single inheritance, virtual by default
Garbage collection (Boehm, opt-out)
Covers, function overloading
Partial type inference, more type-checking
Arrays, pointers, manual memory management
Generic functions, generic classes, collections
Interfaces, operator overloading, properties
Closures, first-class functions, map/filter/reduce </li></ul>
What? <ul><li>I was gonna describe the syntax here
But we're short on schedule so I'll just sum it up:
Upcoming SlideShare
Loading in...5
×

ooc - A hybrid language experiment

877

Published on

An introduction to the motivation behind the ooc project.

In a nutshell: software sucks, tools sucks, languages sucks - examples of what not to do. How ooc allows you to do pretty much aything with a few building blocks. An overview of the advantages/strong points of ooc.

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
877
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "ooc - A hybrid language experiment"

  1. 1. ooc A hybrid language experiment
  2. 2. Why? <ul><li>Software sucks </li><ul><li>It's unreliable
  3. 3. It's slow
  4. 4. It's too hard to develop
  5. 5. It's not modular enough
  6. 6. [insert rant here] </li></ul></ul>« The quality of a piece of software is inversely proportional to its popularity. » — Buchheit's law
  7. 7. Why? <ul><li>The fate of popular software </li></ul>
  8. 8. Why? <ul><li>Languages suck </li></ul>void (* signal ( int , void (* fp )( int )))( int );
  9. 9. Why? <ul><li>Languages suck </li></ul>void (* signal ( int , void (* fp )( int )))( int ); signal : Func ( Int , Func ( Int )) -> Func ( Int ) ✔ ✘
  10. 10. Why? <ul><li>Tools suck </li></ul>small.cpp(17) : error C2664: 'class std::_Tree<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >const ,int>,struct std::multimap<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<int> >::_Kfn,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<int> > ::iterator __thiscall std::multimap<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<int> >::insert(const struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,int> &)' : cannot convert parameter 1 from 'const int' to 'const struct std::pair<class std ::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,int> &' Reason: cannot convert from 'const int' to 'const struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> const ,int>' No constructor could take the source type, or constructor overload resolution was ambiguous
  11. 11. Why? <ul><li>Tools suck </li><ul><li>GNU autoconf, automake, autoreconf – masochism
  12. 12. GNU ld – the kitchen sink of linkers
  13. 13. GNU make – the brainless servant </li></ul><li>Bad workers blame the tool </li><ul><li>What if good workers do too?
  14. 14. Break with tradition </li></ul></ul>
  15. 15. Why? <ul><li>School assignment in C – laziness. </li><ul><li>4 months later – ooc 0.1
  16. 16. « Version 1 Sucks, But Ship It Anyway » – J. Atwood </li></ul></ul><ul><li>Finding a purpose </li><ul><li>To remove obstacles
  17. 17. To encourage experimentation
  18. 18. To minimize frustration </li></ul></ul>
  19. 19. What? <ul><li>Classes, abstract, single inheritance, virtual by default
  20. 20. Garbage collection (Boehm, opt-out)
  21. 21. Covers, function overloading
  22. 22. Partial type inference, more type-checking
  23. 23. Arrays, pointers, manual memory management
  24. 24. Generic functions, generic classes, collections
  25. 25. Interfaces, operator overloading, properties
  26. 26. Closures, first-class functions, map/filter/reduce </li></ul>
  27. 27. What? <ul><li>I was gonna describe the syntax here
  28. 28. But we're short on schedule so I'll just sum it up:
  29. 29. « ooc syntax is Java without bullshit  » - Anonymous
  30. 30. I'm sorry if you were offended.
  31. 31. Java offends me too. </li></ul>
  32. 32. Design principles <ul><li>Build upon, extend, divide and conquer
  33. 33. Re-use what makes sense, rewrite the rest as we go
  34. 34. JDK – an example of how NOT to do modularity
  35. 35. SDK – all you need to get started, easy to swap out
  36. 36. Dependency management made easy
  37. 37. Making it easy to use libs encourages good design </li></ul>
  38. 38. Acronym fair <ul><li>DRY
  39. 39. KISS
  40. 40. IYFF
  41. 41. YAGNI
  42. 42. RTFM RTFC
  43. 43. TMTOWTDI </li></ul>
  44. 44. Paradigm City <ul><li>Procedural </li></ul> println(&quot;Is i+=1 deterministic?&quot;)
  45. 45. Paradigm City <ul><li>Object-oriented </li></ul>Window new(&quot;Vista&quot;). add( Button new(&quot;Buy&quot;). connect(&quot;clicked&quot;, || &quot;Seriously?&quot; println() ) ). showAll()
  46. 46. Paradigm City <ul><li>Generic programming Cell: class <T> { data: T next: This<T> init: func (=data) {} } c := Cell new(42) </li></ul>
  47. 47. Paradigm City <ul><li>Functional </li></ul>(1..100) map(|x| x*x) reduce(|a, b| a+b)
  48. 48. Paradigm City <ul><li>Preemptive multi-threading </li></ul>mutex := Mutex new() Thread new(|| mutex lock() // prove Fermat's last theorem mutex unlock() ) start()
  49. 49. Paradigm City <ul><li>Communicating Sequential Processes </li></ul>chan := make(Int) go(|| chan << question answer := ! chan ) 24h for a basic implementation using libcoroutine 80'000 concurrent coroutines = easy, more with tweaks
  50. 50. Paradigm City <ul><li>...is pretty much a nice walk with ooc
  51. 51. Provide the necessary building blocks
  52. 52. Don't enforce the « one true way »
  53. 53. Politics != Technology
  54. 54. High-level low-level language. </li></ul>
  55. 55. Generating C – the perks
  56. 56. Generating C – the perks throw old VMExcuse ( &quot;I wasn't ready!&quot; ); if name == &quot;__main__&quot; : dont_hold_your_breath ()
  57. 57. Generating C – the perks <ul><li>GCC (Gnu Compiler Collection), TI-GCC, mingw32
  58. 58. TCC (TinyCC)
  59. 59. ICC (Intel C++ Compiler)
  60. 60. Clang (LLVM)
  61. 61. PCC (Portable C compiler - with tweaks)
  62. 62. No MSVC (yet?) - they're too busy with C++0x
  63. 63. ...although in theory it wouldn't be that hard. </li></ul>
  64. 64. Generating C – the perks <ul><li>Did you know that GCC -O2 did TCO?
  65. 65. Turn segfault into infinite loops.
  66. 66. Protip: use -O0 (the default) when debugging </li></ul>
  67. 67. ooc - the platform <ul><li>Self-hosting
  68. 68. Without a doubt the best way to generate C
  69. 69. A real module system. Partial recompilation.
  70. 70. The compiler as a library
  71. 71. C from ooc is easy
  72. 72. ooc from C is easy ( #define OOC_FROM_C )
  73. 73. ooc from Python is dead easy!
  74. 74. ooc from X = reading JSON compiler output </li></ul>
  75. 75. ooc – the tools <ul><li>Good compiler errors
  76. 76. Valgrind, GDB
  77. 77. Alleyoop, Nemiver (GTK frontends for the above)
  78. 78. Callgrind, Kcachegrind, gprof
  79. 79. (Pseudo-)REPL, IRC bot
  80. 80. Emacs mode – flymake, tooltips with compiler errors
  81. 81. Lots of C bindings </li></ul>
  82. 82. Why use ooc? <ul><li>Because you have a llama syntax fetish
  83. 83. As a better C/C++
  84. 84. As a better Java with no VM
  85. 85. Because of the tools
  86. 86. Because of the community
  87. 87. You want to be part of the adventure </li></ul>
  88. 88. What's next? <ul><li>Optimizations </li><ul><li>Generic calls inlining – expect huge speedups
  89. 89. (Please, Mr. Shapiro, don't burst into flames)
  90. 90. Escape analysis, stack-allocation, annotations </li></ul><li>An alternative to exceptions
  91. 91. Typesystem improvements </li><ul><li>Mixins
  92. 92. Typestate? </li></ul><li>Meta-programming, compile-time execution </li></ul>
  93. 93. That's all, folks! Web http://ooc-lang.org IRC #ooc-lang on Freenode Twitter @nddrylliog Mail [email_address]
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×