The Artima Developer Community
Sponsored Link

Java Buzz Forum
Random Typing

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Bill de hÓra

Posts: 1137
Nickname: dehora
Registered: May, 2003

Bill de hÓra is a technical architect with Propylon
Random Typing Posted: Apr 5, 2008 11:45 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Bill de hÓra.
Original Post: Random Typing
Feed Title: Bill de hÓra
Feed URL: http://www.dehora.net/journal/atom.xml
Feed Description: FD85 1117 1888 1681 7689 B5DF E696 885C 20D8 21F8
Latest Java Buzz Posts
Latest Java Buzz Posts by Bill de hÓra
Latest Posts From Bill de hÓra

Advertisement

Charles Oliver-Nutter: "The dream, as I see it, would be to use a Ruby-like syntax to wire up any arbitrary types using what looks generally like idiomatic Ruby code. For example, our friend fib(). The same fib() method I showed before, executing against primitive integer values, could execute against boxed Integer objects or BigInteger objects just by specifying the right plugin. So if within the context of a file, I declare that "fixnum" types are to be represented as BigInteger objects, and math operations against them are to call appropriate methods on BigInteger, so be it...that's what comes out the other side."

Now this is interesting - an algorithm that can be generalised by using pluggable type resolution. It reminds me of something Alex Stepanov said in the "Money Oriented Programming" interview: "Every time I would look at an algorithm I would try to find a structure on which it is defined. So what I wanted to do was to describe algorithms generically." In that interview Stepanov defined generic programming as "finding the most abstract representations of efficient algorithms."

This type wiring does makes wonder (again) what would happen if Python had optional type declarations for function arguments. Aside from being able to look at a function and know what it accepts, it could give a type checker (and ultimately a JIT) a lot of information. Cobra allows you to say that an argument acts "as" a type.  Scala makes you declare types in functions. It's an interesting tradeoff.

Read: Random Typing

Topic: If JavaScript Were Such A Great Language ... Previous Topic   Next Topic Topic: links for 2008-03-30 from PeopleOverProcess.com

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use