Skip to content
This repository
Browse code

modified: Laser:-Static-Analysis-for-Ruby,-in-Ruby.md

  • Loading branch information...
commit b3d98a4e0e6ac97aeb65f35471fca08ae0681f53 1 parent d58e854
Ben Oakes authored October 01, 2011
27  Laser:-Static-Analysis-for-Ruby,-in-Ruby.md
Source Rendered
... ...
@@ -1,3 +1,6 @@
  1
+Synopsis
  2
+--------
  3
+
1 4
 > What truly makes Ruby special as a language is its focus on expressivity, flexibility, and dynamism. Yet these same properties - and their widespread use in the community - make even straightforward application code difficult to analyze statically in a meaningful way.
2 5
 >
3 6
 > Laser seeks to change that. As a general-purpose analyzer using traditional compiler techniques, it statically discovers properties of real-world Ruby programs that no existing tool can. This talk is a whirlwind tour of what Laser can do, how it does it, and what it means for a typical Ruby programmer (who doesn't want to litter his or her code with type annotations). Among the questions it attempts to answer:
@@ -13,3 +16,27 @@
13 16
 > * What gets added to a class by calling a method like acts_as_list?
14 17
 >
15 18
 > Most importantly, Laser uses this information to find bugs and tell you about them, in addition to warning you about potential mistakes. It has a clear integration path with YARD and Redcar, as well as a possible future in optimization. On a broader scale, Laser exposes and builds upon the underlying strength and regularity of Ruby and modern Ruby techniques, without restricting Ruby's natural expressivity through static typing.
  19
+
  20
+Laser
  21
+-----
  22
+
  23
+* Runs Ruby code with `Laser#Magic`; not strictly static analysis
  24
+* Ruby Object Model reimplemented in Laser
  25
+* `LaserMethod` -- one instance per method in analyzed program
  26
+* Cartesian Product Algorithm (by Agesen -- created for Smalltalk/Self)
  27
+  * Reasoning about types
  28
+  * Duplicating Cartesian graph on types
  29
+  * LaserMethod#return_type_for_types
  30
+* Expected return types (warnings based on `#to_s`, `#to_a`, `!`, etc)
  31
+* Unused methods based on the `been_used` flag.  Again, it's running your code to figure this out.
  32
+* Unused vars (in parser!).  Can't tell dead code.  :(
  33
+* Other algo... missed its name.  It's O(V) in running time.
  34
+* Block usage.  Seems crazy.  Too much to write down.
  35
+  * Sends in a canary, tests to see if it's called like a block would be with `yield`, `block_given?`, `iterator?`, etc.
  36
+  * Checks recursively
  37
+* Simulation
  38
+  * Interpreting Ruby in Ruby
  39
+  * Way slow.
  40
+* CFG isn't conservative enough.  Known to be wrong.
  41
+
  42
+He's doing Java and Python at Google now.  Not sure if Laser is going to do a ton more.

0 notes on commit b3d98a4

Please sign in to comment.
Something went wrong with that request. Please try again.