Skip to content

Instantly share code, notes, and snippets.

@datagrok
Last active September 18, 2015 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save datagrok/248149407d29e5843cec to your computer and use it in GitHub Desktop.
Save datagrok/248149407d29e5843cec to your computer and use it in GitHub Desktop.
Questions while reading stuff

Python

__debug__ vs. -O

Python has a built-in variable __debug__ which is set to True when python is called without -O (optimize). The -O flag disables all assertion code.

This seems at first glance like a very easy and clean construct to rely on when coding in development versus production: in development, don't use -O, defensively litter your code with type- and sanity-checking asserts. Perform development-only debugging by testing __debug__ beforehand.

When in production, run all code is run with -O which disables asserts (speeding execution) and sets __debug__ to False.

Why is this construct not more popular? Why does nearly large-ish collection of python code re-invent a DEBUG global variable or the like and ignore __debug__?

Scheme

Reading http://en.wikipedia.org/wiki/Scheme_(programming_language)

  • Why the necessity for let, let*, and letrec? It seems like let* would do everything that let can do; and letrec can do everything let* can do. If it is a matter of performance (is let simpler and faster than letrec?) then could a clever interpreter determine which of the three was appropriate for any given set of definitions?

Smalltalk

Reading http://blog.moryton.net/2007/12/computer-revolution-hasnt-happened-yet.html

  • Can the "big wins" from smalltalk exist separately from some of its unusual features like
    • image-based persistence
    • a built-in graphics environment with (non-tiling) window manager, (crappy) code editor, and (interesting) code browser?
    • (yes, because some lisps have this image-based computing idea, and some do not?)
  • How does one test, package & distribute small units of smalltalk code?
  • Specifically about image-based persistence:
  • Specifically about SmallTalk's (Squeak's?) built-in graphical development environment:
    • Graphical development environment as desktop environment? As operating system?
    • The whizzy features of being able to interact with rotated UI elements in real-time feels slow. Can the VM take advantage of accelerated graphics libraries like OpenGL?
@kingcons
Copy link

Before I forget, Daniel Lyons has written a huge number of thought provoking posts about these and other languages issues that I think you would find worthwhile. Here are three favorites:

I'd strongly encourage you to read them. In fact, I'd be happy to have a beer/skype session to discuss any individual one. In fact, why the hell don't I start an Atlanta CodeTalkers meetup to discuss papers, actual pieces of code everyone agrees to read, and other weird non-language specific, non-tech specific issues?!? O____O

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment