<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:loupgaroublond</id>
  <title>Yankee's Psycho Programing Semantics</title>
  <subtitle>loupgaroublond</subtitle>
  <author>
    <name>loupgaroublond</name>
  </author>
  <link rel="alternate" type="text/html" href="http://loupgaroublond.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://loupgaroublond.livejournal.com/data/atom"/>
  <updated>2005-08-15T06:06:15Z</updated>
  <lj:journal userid="6934946" username="loupgaroublond" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://loupgaroublond.livejournal.com/data/atom" title="Yankee's Psycho Programing Semantics"/>
  <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:loupgaroublond:1266</id>
    <link rel="alternate" type="text/html" href="http://loupgaroublond.livejournal.com/1266.html"/>
    <link rel="self" type="text/xml" href="http://loupgaroublond.livejournal.com/data/atom/?itemid=1266"/>
    <title>my crazy clipboard idea</title>
    <published>2005-08-15T06:05:26Z</published>
    <updated>2005-08-15T06:06:15Z</updated>
    <content type="html">Ok, so this will be an addition to my object oriented operating system addiction:&lt;br /&gt;&lt;br /&gt;So assuming we have some GUI system that is designed from a proper OO sense, we can assume that any time data is sent to the clipboard, some clipboard event is generated.  And as follows, a ClipboardEventListener (to use the Java phraseology tonight) recieves this event.  (Multiple listeners can recieve it too, as long as they don't conflict later on, and we'll see why).  Our obvious standard clipboard listener would take the data, parse the datatype and interfaces using some element of the API, and generate some stub such that any other object/application can request a reference/copy of that stub containing the data and any possible metadata.  It would put that into a single memory space, overwrite the old one, etc...&lt;br /&gt;Now there are many re-implementations of the clipboard.  Microsoft uses a kludge within the MS Office framework where it maintains a limited history of the clipboard.  Gnome and KDE use a subtle kludge on top of the X Windows clipboard making it slightly more user friendly.  KDE even has a klipper tool that maintains a user configurable history.&lt;br /&gt;What if we were to do away with all these kludges?  First, I propose that we have the option of passing a setClipboardEventListener/addClipboardEventListener message to the windowing system with rules on what permissions an object would require to arbitrarily reconfigure the clipboard.  And how do old clipboards communicate with new ones what to do with their clipboard histories?&lt;br /&gt;Secondly, I propose justification for bending over in this mental kama sutra.  I am doing some data entry work that requires massive amounts of copying and pasting.  I will take little bits of data from many files that I want in a list as one file.  If i had the ability, I would write a simple plugin to give me a new clipboard mode.  Everything I copy is stacked one by one on the clipboard in a Queue+Stack of arbitrary length.  I could then have my clipboard object register shortcuts to my environment that let me pop items off either the Queue, Stack, or anywhere in the middle.  If this were emacs, I might type something like C-v 35th and have the 35 item pasted.&lt;br /&gt;Anyways, those are my two cents on something totally trivial and pointless.  G'night all.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:loupgaroublond:840</id>
    <link rel="alternate" type="text/html" href="http://loupgaroublond.livejournal.com/840.html"/>
    <link rel="self" type="text/xml" href="http://loupgaroublond.livejournal.com/data/atom/?itemid=840"/>
    <title>Lambda Datatypes and Aspect Classes</title>
    <published>2005-06-28T05:22:34Z</published>
    <updated>2005-06-28T05:22:34Z</updated>
    <lj:music>None</lj:music>
    <content type="html">Time for another post.  I have work in the morning, so mainly I'm going to address a comment on my first post.  I also have an idea thats completely incomplete, and I'm tired enough to not want to solve it now.&lt;br /&gt;Its a fairly simple idea with many complex reprecussions.  One element of Object Oriented Programming is Inheritance.  Some languages allow you to inherit from only one class, and some allow you to inherit from more than one class.  Dual inheritance is not a problem until you consider what happens when both super classes share a common super class.  Both classes are initializing the same base class, and no one knows which one is dominant or passive, and how to keep both classes from changing the base class in ways that are incompatible with each other.&lt;br /&gt;(I apologize for the confusion those last few sentences have; this is a common CS problem, and I'm too tired to explain in detail now.  Just ask for a better explanation if you don't fully understand)&lt;br /&gt;For those familiar with Aspect Oriented Programming, this might make alot of sense.  First some background however.  I have been working on a small framework for some very simple IRC bots.  There is a simple base class that all IRC bots have, that already contain the code to make a connection to an IRC server, stay connected, join and part channels, and optionally execute arbitrary code for debugging purposes.  I then came up with several tasks or aspects a bot might want to perform, tasks such as randomly saying thing, quotes, phrases, single words, logging the chat and compiling statistics, or providing authentication for operator status.  (This server doesn't have any service bots.)  I want to be able to create aspect classes that a Rabid Developer (my nickname for programmers who uses lots of premade code and glue it together to create all sorts of complex programs) can take to mix and match the different pieces he needs.  These would be classes that have limited functionality, such that they can only touch the base class in specific predescribed ways.  The Aspects would need to be written by the base class developer and by no one else, so that he(they) can ensure they are all compatible with each other, or at least document which ones don't work with which other ones.  Other than this, I have this mental block trying to figure out what some of these rules should be.&lt;br /&gt;Now here is the part where we answer a few of your letters.&lt;br /&gt;Nightstrike9809 wrote: Its a truly interesting idea but I feel I am missing the true point of this, how would you implement Lambda Datatypes?&lt;br /&gt;This is no different than template functions in C++.  However, from a semantical point of view (and not necessarily that of the compiler)  I am thinking of creating an Interface to borrow a term from java for a Function&amp;lt;...&amp;gt; that can have any number of generic data types, but is forced into using it.  There would then be a required method __func__(...) that could take any number of parameters (possibly defined by the generic datatype decleration) and to borrow from python, this would make all objects implementing this interface "callable" and capable of being passed arguments, returning arguments, etc....&lt;br /&gt;You can figure how badly you want to kludge your language's syntax from here.&lt;br /&gt;As to why I would want to torture myself to provide such odd functionality, its the same argument as using templates/generics in the first place.  From my academic high point, I feel that the compiler should spot as many errors first, which translates into better syntax error detection on the IDE's behalf as well.  Anyone familiar with Eclipse should understand how much this can be a help (or hinderance).  The basic idea works like this though.  I have my callback function.  When its called, its called with arbitrary data some other programmer in my project team passed to me.  I want a garauntee that this chunk of data implements methods X, Y, and Z.  By using generics, I can tell this peer of mine, I will only accept objects that implement these methods.  When I pass the callback to the connect method of a widget, I might pass it like this:&lt;br /&gt;&lt;br /&gt;widget.connect&amp;lt;String&amp;gt;(some_callback, "From John")&lt;br /&gt;&lt;br /&gt;void some_callback&amp;lt;D implements String&amp;gt;(Widget widget, D data) {&lt;br /&gt;    other_string = data + " with love";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Thats it for now, I'm tired, Good night.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:loupgaroublond:457</id>
    <link rel="alternate" type="text/html" href="http://loupgaroublond.livejournal.com/457.html"/>
    <link rel="self" type="text/xml" href="http://loupgaroublond.livejournal.com/data/atom/?itemid=457"/>
    <title>First Entry | Lambda Datatypes</title>
    <published>2005-06-04T05:50:20Z</published>
    <updated>2005-06-04T06:32:11Z</updated>
    <lj:music>Radiohead - Kid A</lj:music>
    <content type="html">Lately I have had a lot of interesting ideas for computer programming, and I finally decided, I should keep a journal of my ideas to share them with others and so that they can give me feedback on it.  If I get good at keeping this thing up to date, I might even write a more personal friends only journal.&lt;br /&gt;&lt;br /&gt;To give you hopefully faithful readers an idea of where this is coming from, my name is Yaakov, and I am a Computer Science and Engineering major at the University of Connecticut, which, if you haven't figured it out, means I live in the US.  Hence, I make no apologies.  Although I have known the fundamentals of programming since i was nine, I have only recently in the past year and half began taking programming seriously and wanted to explore more than just the BASIC material I have known till now. (Pun Intended).  Most of my ideas involve creating a flexible language similar to Python or the POSIX Shell, that is also robust like Java, C#, and Objective-C, and (you can start laughing) low level enough for an operating system to be written in it.  Simply put, one Operating System, One Language, One set of commands to memorize, and One ring to bind them all.  (There will be room for other languages, and I will probably write more on this later, so save your flames for then.  Thank you.)  In the past year I've been programming in Java, and my first set of posts will most likely take a slant in that direction.  Such as this one.&lt;br /&gt;&lt;br /&gt;Onto the goal of this post.  My current language of choice is Python.  I've been using it for one of its common descriptions.  It's a convenient glue between many different programs and libraries on my computer.  It's designed around the whole 'nix structure so most of what is available to me is integrated very nicely.  However, one thing has been pissing me off tremendously.  Java is incredibly strict about its data types; so strict that I am garaunteed the second my fingers touch the keyboard what methods are available on the data that I am working on.  Python can't do that.  I don't blame it; I think it is a fine language in how and what it implements and why it implements it as such.  This won't meet my goals.  Compile time checking is as important to me as Garbage Collection.  It ensures certain basic things programmers take for granted will work as intended without wasting programmer effort keeping track of many details.  I'd love to hear about good uses for run time checking, but other than the case I will discuss later, I don't know of too many cases where I wasn't banging my head against the screen in frustration with python.&lt;br /&gt;&lt;br /&gt;Abstract&lt;br /&gt;The following proposition is intended to create a consistent structure that gives the programmer some of the benefits of Python's weaker data type declaration system without sacrificing compile time error checking.  I will discuss one specific case now that I've run into with the pygtk libraries, and save the more general purpose for discussion later.  This idea is also incomplete as of now.&lt;br /&gt;&lt;br /&gt;Background&lt;br /&gt;Some Object Oriented languages that require strict type declaration implement some system of template classes that can be compiled multiple times, each time handling a different data type.  Java's system is a favorite of mine.  Not only is it incredibly consistent and the compiler issues are hidden very well from the programmer (unlike in C++), it even lets you create a contract saying that all data types must implement a certain interface (i.e. a certain set of methods).  Furthermore, some languages that implement procedural functions (such as C++) also implement templates for said procedural functions.&lt;br /&gt;&lt;br /&gt;Theory&lt;br /&gt;At a cursory glance, Python has many structures simiilar to C++ and Java that appear as if they could be controlled with better type declaration.  Certain aspects (methods like __ge__(x)) could be moderated into a set of interfaces such as Numerical and StringLike (suggestions are open for better names).  However in my discovery of the pygtk libraries and its implementations of signals I found a case that would be difficult to enforce strong typing.  I will assume the reader is familiar with signals and event based programming.  (If I get many requests going "Huh?" or the like, I'll put up an entry explaining this.)  I can create a callback function with the signature:&lt;br /&gt;&lt;br /&gt;                    callback(widget, data)&lt;br /&gt;&lt;br /&gt;where data can be any arbitrary data that can be passed from the widget emiting the signal.  This data is usually specified when connecting the signal to the emiter using the signature:&lt;br /&gt;&lt;br /&gt;                    widget.connect(callback, random_data)&lt;br /&gt;&lt;br /&gt;and random_data could be any type.  In Java, this random data would have been passed as type Object which is the supreme ancestor data type for any class.  However, inside the callback function, I would have to typecast this Object into my desired data type which results in run time checking.  Queue templates, for the same reason Java 5 introduced them.  Only this time, the templates apply to the method.  I have a connect signature like so:&lt;br /&gt;&lt;br /&gt;                    widget.connect&amp;lt;D&amp;gt;(CallBack callback&amp;lt;D&amp;gt;, D random_data)&lt;br /&gt;&lt;br /&gt;and the callback is:&lt;br /&gt;&lt;br /&gt;                    callback&amp;lt;D&amp;gt;(Widget widget, D data)&lt;br /&gt;&lt;br /&gt;Simply put, our class methods can create their own arbitrary data types seperate from the template data types they are already working with.  There is an obvious responsibility for programmer to keep the template names from colliding because our methods obviously inherit the template type namespace from their class.  If I have the type T floating around already, my new type can't be called T, though D is a valid name.  I call these Lambda datatypes because in terms of creating lambda functions, we are creating lambda functions that take a datatype as a parameter and return a function or class specific to that datatype.  Obviously the overhead in treating it that way means the compiler will do things differently, but the concept is the same.&lt;br /&gt;--fin--</content>
  </entry>
</feed>
