1. Shashank Bharadwaj
  2. jython-notes

Commits

Shashank Bharadwaj  committed 0b22600

more trimming

  • Participants
  • Parent commits 8f84412
  • Branches default

Comments (0)

Files changed (1)

File pycon-2013/slides.md

View file
  • Ignore whitespace
 Gradual Typing
 ==============
 
-* Originally proposed by Jeremy Siek and Walid Taha, extended by others
-* Optionally introduce static types into a dynamic language
-<!--*Optionally introduce dynamic type into a static language -->
+* Proposed by Jeremy Siek & Walid Taha; extended by others
+* Introduces a dynamic type in an static language
 * Seamless integration between statically typed part and dynamically 
-  typed parts of the language
-* Promises that statically typed part will never raise a TypeError
+  typed parts of code in the langugage
+<!-- * Promises that statically typed part is ``Type Safe`` -->
 
 Gradual Typing for Python
 =========================
 
+* `gradual` module in Python 3.x
+* Provides type checking based on type annotations 
+* Uses function annotations and decoraters
+
 * Prototype - in experimental mode!
 * `pip install gradual` to get it
-* Repo at:  `http://bitbucket.org/gradual/`
+* Repo at:  `http://bitbucket.org/gradual/py-gradual`
 
 Gradual Typing for Python - Example
 ===================================
 def use_api(x: YourAwesomeApi):
     print(x.answerToLife(10, 32))
     print(x.answerToLife('hello', 'there'))
-    # TypeError: Expected int, got: 'hello' of type str
-
-    x.aNewFunction('hello world')
+    # TypeError: Expected int, got:
+    # 'hello' of type str
 
 use_api(YourAwesomeApi())
 ~~~~~
 
-Gradual Typing for Python
-=========================
-
-* Prototype - in experimental mode!
-* `pip install gradual` to get it
-* Repo at:  `http://bitbucket.org/gradual/`
-
+Gradual Typing for Python: Work in Progress
+===========================================
 
 * Working on accurate representation of objects
 * Working on **Blame Tracking** to produce accurate error messages
 
-Future: Integrate Gradual Typing into Jython [1]
-================================================
+Future: Integrate Gradual Typing into Jython
+============================================
 
 * Use Gradual Typing to enable direct importing of Python code in Java
 
 * Most Python code has one-one corrospondence with Java code
-* Drive type information to generate idiomatic Java code (where applicable)
-
-Future: Integrate Gradual Typing into Jython [2]
-================================================
-
-* More effieciently import Java code into Python
-
-* Java code could be treated as `typed` Python code.
-* Greatly reduce the cruft involved in importing Java code
-<!-- because it looks more like Java-->
-
-<!-- may hide this next slide -->
-Future: Integrate Gradual Typing into Jython [2]
-================================================
-~~~~~~
-void type___setattr__(String name, PyObject value) {
-  PyObject field = lookup(name);
-  if ((field != null) && (field._doset(null, value)))
-      return;
-  if (modified == null) modified = Generic.set();
-  if (modified.add(name)) && (conflicted != null) {
-     for (PyJavaType conflict : conflicted) {
-      if (conflict.modified != null && 
-          conflict.modified.contains(name)) {
-        throw Py.TypeError("inconsistent");
-      }
-    }
-  }
-  object___setattr__(name, value);
-  postSetattr(name);
- }
-~~~~~~
+* Drive type information to generate idiomatic Java code (where applicable