Archive for the ‘Languages’ Category

Deliberately Do Things Wrong When Learning a New Language

Monday, October 6th, 2008

I read Is learning Perl the hard way the easy way? recently.

Andy Lester links to Learning Perl the Hard Way.

Reading the PDF, Allen B. Downey makes a great suggestion when learning new languages.
He says, “As you are experimenting with a new language, I suggest that you make deliberate errors in order to get familiar
with the most common error messages
.”

That is some of the simplest, best advice I’ve heard in a while.

Beating my head with PLT Scheme

Thursday, February 21st, 2008

I’ve been trying to communicate with a perl process from PLT Scheme using the process library call from scheme/system.

I’ve been a good systems boy making sure that I call flush-output after every string I write to the perl process. But the perl process never gets any input unless I close the output side of the pipe connected to perl’s stdin filehandle.

After hours of no progress I found this

http://pre.plt-scheme.org/plt/doc/release-notes/mzscheme/MzScheme_300.txt

* File-stream output ports (including file ports, the initial output
port, and ports created by `subprocess’) are now block-buffered by
default, instead of line-buffered. The exception is when an output
port corresponds to a terminal, in which case it is line-buffered
by default. Also, the initial error port remains unbuffered.

TCP output ports are block buffered (instead of unbuffered) by
default.

The file-stream changes are especially likely to affect stdio-based
communication among OS-level processes. For example, when
communicating with an ispell subprocess, adding a newline at the
end of a command previously would have been enough to send the
command to ispell. Now, the output must be flushed explicitly
(using `flush-output’) or the buffer mode must be explicitly
changed to by-line (using `file-stream-buffer-mode’).

The TCP changes affect most TCP-based communication. Explicitly
flush output using `flush-output’ or change the buffer mode using
`file-stream-buffer-mode’.

So I said what the heck, I’ll just add a (file-stream-buffer-mode outp ‘line)
call for grins.

And it started working.

John Backus (creator of Fortran and Backus Normal Form, BNF) Passes Away

Tuesday, March 20th, 2007

I just read on Lambda the Ultimate that John Backus passed away this past Saturday.

John Backus Receives the Turing Award
John Backus in the 1990s. Courteous IBM.



In his speech accepting the Turing Award, John Backus admonishes developers and computer scientists to look towards functional programing. He states that the composability and mathematical rigor of functional programming empowers programmers to scale and best describe the ever increasing complexity of problems. Interestingly, Backus describes the von Neumann architecture and its associate imperative programming language as obese. Backus continues saying that these obesities encourage micro-managed word at a time computing. Instead of moving data between named locations, we should focus on the larger conceptual units of the problem says Backus.

I see this debilitating behavior every day, both in developers and managers. Most IS/IT managers get caught up in the word at a time or task at a time work flow that cripples teams and organizations. Senior developers and managers must be instructors and mentors in the enterprise. They must be experience practitioners of abstraction and modeling. Their first and most important priority must be to impart the skills of scale, abstraction, modeling, and reuse to those they mentor.

Simple Bayesian Networks – Carl Youngblood (Mountain West Ruby Conf)

Friday, March 16th, 2007

Problems with causable Agents

  1. Impotence
  2. Theoretical Ignorance
  3. Pratical Ignorance
  • How to handle uncertainty?
  • Enter Probability Theory
  • Probability provides a way to of summarizing the uncertainty that comes form our laziness and ignorance

Basic Probability Theory

Bayesian Networks

Inference Methods

  1. Exact (potentially exponential)
  2. Approximate (less Accurate) – stochastic or Monte Carlo algorithms

Simple Bayesian Networks with Ruby

SBN – gem install sbn

  • 2003 – Class project
  • 2005 – C++ version
  • 2007 Ruby version

“Premature optimization ois the root of all evil.” Donald Knuth, paraphrasing C.A.R. Hoare

Pragmatic Community Driven Development in Ruby – Gregory Brown (Mountain West Ruby Conf)

Friday, March 16th, 2007
  • 86 Slides
  • Rolling the Dice with Ruport
  • Reporting Sucks
  • #mwrc irc.freenode.net
  • Ruby is a community, we should love Ruby and need Ruby
  • Are we dealing with ideologically problems, Firefox logo vs IceWeasel Logo
  • Good software is produced by involving a community
  • Lets analyze Ruport
  • Ideals:
  • Ruport is GPL. License Choices do Matter. It is important to poll the communities opinions of licenses.
  • Licenses are hard to change, Ideology isn’t
  • Don’t write your own license. It’s a matter of comprise.
  • Free Software is a gift
  • BSD/MIT favors individuals.
  • GPL favors communities.
  • RubyLang is dual licensed
  • Go with RubyLangs license and you will probably be ok with the free software crowd
  • Communities are warehouses of ideas
  • You can’t please everyone in four weeks, working part-time
  • You can only really work passionately on your problems.
  • Learn when to say no to feature bloat or -O nofun.
  • Sometimes Less is More. Tens vs Thousands. Much easier to read tens of emails vs thousands of emails per week.
  • Mailing List != Bug Tracker
  • GForge is nice. But is it what you need? Ruport needed SVN/Trac
  • Trac blurs the lines between developer/contributor/user
  • svk + cron allowed use to mirror our Trac SVN repo to the RubyForge SVN repo.
  • Tools Matter:

  • Trac has improved participation in Ruport
  • Friction Effects Contribution
  • Technical decisions and input shouldn’t occur on RubyTalk
  • Every patch, even if unapplied is valuable. Don’t dismiss them. Examples and tests can come from patches.
  • What’s Relevent

  • Create a roadmap.
  • Telling yourself what your software is, helps you build it.
  • Design Goals need scoping as well as features.
  • Use cases can drive development. We invite people
  • No Cruise-Control

  • Don’t introduce things that are only meant for you, the developer, or one single user
  • Move non-essential features or customizations for single users out to plugins.
  • Unique Poject Identity is good

  • Be Bold about your decisions

  • Take risks
  • Come up with crazy ideas
  • Start finding your community early.
  • One Last Thing – One Last Good Idea

  • Ruport 1.0 2007.05.15

Questions/Comments:

  • Look around us at other projects and how they use their community building skills.
  • Make it easy
  • Meta-documentation that describes basic processes such as howto submit but reports, patches, etc
  • Make meta-documentation stupidly easy to find
  • We need to create a collection of best practices for managing ruby projects.
  • Go read the book “Producing OpenSource Software“. It’s free online. Go Read it.

RubyQueue – Ara Howard (Mountain West Ruby Conf)

Friday, March 16th, 2007

RubyQueue is an embarrassing parallel work queue system that simply uses NFS directories as a shared queue.

  • NFS lock sharing isn’t defined to be fair. Ruby Queue uses a exponential back off algorithm to try to make NFS locking more fair.
  • NFS uses arbitrary ports, because of portmap, which causes problems for firewalls. It is possible, however, to pin those ports which makes firewall traversal possible.

DivaScheme

Wednesday, November 1st, 2006

My master thesis was written in Scheme, so I’ve spend a long of time with PLT Scheme in the last year. DrScheme is cool for teaching others scheme especially in classroom settings. The editor key bindings however are atrocious. Enter DivaScheme to the rescue.

RubyConf: John Lamb: You’ve got your Ruby in my CLR

Sunday, October 22nd, 2006

I build a program for my child every year for his birthday.

For his second birthday I wrote a flash card app using Ruby and Avalon on .NET.

So I needed to connect Ruby to .NET.

So pragmatism and laziness lead me to build a bridge.

Marshaling of primitives like integers are easy. The devil is in the details.

I start at Microsoft in the CLR team in January. I’m going to work making dynamic languages run better on the CLR.

We want to take IronPythons work and try to apply it Ruby. Can IronPython’s method dispatch be generalized and applied to Ruby?

Will dynamic languages be used in five years to build business applications? We hope so. How?

Success is when the intersection between “What you WANT to do” and “What you ACTUALLY do” increases.

The goal is Happiness.

How does the Ruby.CLR bridge work.
dynamic methods in the CLR will allow other projects liek Ruby.NET to implement Polymorphic Inline Caching(PIC).
const_missing allows faulting in of new proxy classes.

method_missing allows creating of method shims when faulting.

http://www.rubyclr.org

http://www.iunknown.com

RubyConf: Koichi SASADA: YARV: on Rails?

Sunday, October 22nd, 2006

Caution (re-review)
I can’t speak English well.
If I say strange English, you can see the slide page.
If you have questions please ask in Japanese, Ruby, Python, Lisp, Smalltalk, or Haskell, not english.
I got a job! My office is at Akihabara. Otaku City.
Akiba-Kei – Please check this word on wikipedia.
An Assistant of The Univ. of Tokyo.

RubyKaigi 2006 – 200 tickets sold out in 300 hours (DHH and Matz were the keynote speakers)
RubyKaigi 2007 – Dave Thomas and Matz are expected to keynote.

Koichi showed a simple scaffold rails app on YARV.
Congrats Koichi.

YARV
Simple Stack Machine
Specific VM Instructions YARV Instructions
Compiler
Interpreter (VM)
Many Optimization techniques to improve performance.

http://www.atdot.net/yarb/

RubyPorgram -> Compiler -> YARV Instruction Seq-> VM(Execution)

Optimizations
Compile time optimization
Direct threaded code
Specialized instructions
Operands/Instructions Unifications
Inline (Method) cache
Static stack caching
Profiler
more …

YARV doesn’t improve text processing,

YARV can assemble and disassemble assembly instruction sequences.
Instruction Sequences can be serialized and deserialized.

YARV will have a Mutex Class, but Thread.critical will become UNSUPPORTED with YARV. This will require Thrad.critical users to change there code.
Default threading model will be non-parallel with a giant lock, this allow existing non thread safe or non reentrant c extensions to continue to work.

#yarv irc.freenode.net, but Koichi is always marked AWAY, use mailing list.

http://i.loveruby.net/autobuild/yarv

YARV lacks a Hook interface
Needs to catch up to current 1.9
JIT/AOT Compiler AOT has been started but it is incomplete.

Compare vs. x10, Fortless Fortress?, Chapel

http://www.atdot.net/yarv/rc2006_sasada_yarv_on_rails.pdf

RubConf: Streamlined: Justin Gehtland

Sunday, October 22nd, 2006

Streamlined: Quit Banging Rocks Together and Build Something
Admin and maintenance backends are repetative.

Streamline was built for our clients, based on our needs, to save our wrists. We know we’re a real project already because …. we are experiencing FUD. People say we’re a code generator, I’m here to clarify the FUD.

GOAL: Bring the declarative goodness of ActiveRecord to the view layer.

Scaffold suck, we need really good scaffolds, hence Streamlined.

Streamlined has a new look and feel called grail.

The fud exists because right now streamlined is kicked off as scripts/generate streamline. But really the generate script is just installing a plugin.

  • Sparklines is built in.
  • Pagination can be turned off.
  • Popup views are now included

The way that we manage relationships should be introspective and flexible.

Views are GENERIC. But you can define custom views for fields. The generic views are overridable.

The key factor in the architecture is that all the configuration of streamlined is done in ruby.

  • Columns of your CRUD can be included or excluded.
  • Streamlined is customizable on a per user basis.
  • Authorization, role based management is coming.
  • Model-specific behavior.
  • Layer-specific fields, fields can show up only in certain view such as edit but not show.
  • Visual configuration is coming christmas time.

streamlinedframework.org

gem install is coming this week

public svn is available.

Q: Will visual configuration write its data to the source code files
A: Yes

Q: Are you working on supporting Dr. Nicks magic models
A Not Yet, but we would really like to.