• Save
Brython
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Brython

  • 1,082 views
Uploaded on

Over the past few years, many have thought of the concept of using Python, instead of javascript, for client-side programming. Guido van Rossum, during his keynote talk in PyCon 2012, said that......

Over the past few years, many have thought of the concept of using Python, instead of javascript, for client-side programming. Guido van Rossum, during his keynote talk in PyCon 2012, said that "Introducing a new language to replace javascript, is just such an incredibly hard political problem..". During this talk I briefly introduced Brython. Brython's goal is to replace Javascript with Python as the scripting language for web browsers. But lets think about it for a moment.. Is this really what we want? :)

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,082
On Slideshare
1,082
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Brython www.brython.infoSpyros Ioakeimidisspyros.ioakeimidis.infoPyGrunn June 2013Python in the client-sideof programming
  • 2. What the ****are they thinking?Brython???
  • 3. But How?
  • 4. Step 1: Read Code
  • 5. 1parses Python source codebrython():
  • 6. 1ajax call for, e.g.<script type=‘text/python’ src=‘example.py’></script>parses Python source codebrython():
  • 7. Step 2: Syntax Analysis
  • 8. 2abstract tree is built and transformedpy2js():
  • 9. 2the moment to deal with errorsabstract tree is built and transformedpy2js():
  • 10. Step 3: Generate Javascript
  • 11. recursively creates the javascriptcode out of the abstract tree3to_js():
  • 12. Step 4: Execute Javascript
  • 13. 4eval()
  • 14. Characteristics
  • 15. numLOC(brython) ≈≈ numLOC(jQuery)Less Code?
  • 16. importworks with ajax calls
  • 17. importworks with ajax callsfrom the same directory of the calling script
  • 18. importworks with ajax callsfrom the same directory of the calling scriptpackages are not supported, only modules
  • 19. white spaces andindentation matter! :).min
  • 20. Compatibility✌write Javascript, jQuery codeusing JSObject()Javascript
  • 21. Compatibilitybrowsers
  • 22. ajaxajax is pretty easy to use (as it should be)using ajax()
  • 23. missing...some (not so commonly used) Python functionswith keyword is not implemented yetno cookie implementation
  • 24. more...no noticeable difference in efficiencyHTML5 and SVG support :)
  • 25. more...still too immaturedefault use of ajaxundocumented (still to early though :)
  • 26. The simplest Task app ever!to be continued...
  • 27. SO?
  • 28. It doesn’t always feel likewriting Python code
  • 29. Nothing yet that can distinguishit from existing solutions
  • 30. “Introducing a new language to replaceJavascript, is just such an incrediblyhard political problem...Guido Van Rossum@PyCon 2012
  • 31. I enjoyed much more writing Pythonthan Javascript :)
  • 32. Thank you!