Arguably, for the
Ruby
computer programming language, the default
graphical user interface
(GUI) toolkit is Tk (a part of
Tcl/Tk).
A high-level toolkit, it is cross-platform as well.
Some ways of installing Ruby include Tk automatically.
Tk has been given a beautiful introduction in a
tutorial
by Mark Roseman at
TkDocs.
Begun in 2008 (its full history can be seen
here),
it covers multiple languages:
Perl 5,
Python 3,
Ruby,
and
Tcl.
Roseman's tutorial provides eighteen (18) code examples.
They are all written in each of the four languages listed above.
Naturally, the code is written in a way which eschews each language's idiomatic features.
At least, uncomfortably, I experienced this for Ruby!
In order to learn more fully how to use Tk, I borrowed the tutorial's Ruby example code and rewrote it, using the kind of programming style I might use for production.
All eighteen of the resulting Ruby production-style example programs (each in its own file) together comprise my GitHub repository,
tutorial-tkdocs.
Copyright (c) 2019 Mark D. Blackwell.
Showing posts with label computer language. Show all posts
Showing posts with label computer language. Show all posts
Sunday, March 17, 2019
Wednesday, August 1, 2018
Install Ruby and Git For Windows on Windows XP, howto
Here's how to install the last binary releases, of both Ruby and Git for Windows, which work on 32-bit Windows XP (SP3):
Copyright (c) 2018 Mark D. Blackwell.
- Install RubyInstaller.org's binary for Ruby, version
2.0.0-p648 (but don't download from this link; it's for reference, only):
- Download and execute the asset, rubyinstaller-2.0.0-p648.exe from column RubyInstallers, on the RubyInstaller archives webpage.
- This is the last binary version of RubyInstaller to support 32-bit Windows XP.
- I identified it by trial-and-error.
- Install Git for Windows:
- Download and execute the asset, Git-2.10.0-32-bit.exe containing version 2.10.0.
- This is the last binary version to support 32-bit Windows XP, per the Git for Windows FAQ.
Copyright (c) 2018 Mark D. Blackwell.
Labels:
BASH,
computer,
computer language,
Git Bash,
howto,
install,
legacy,
programming,
ruby,
Windows
Monday, July 8, 2013
Use file extension ".yml" for YAML
Generally, YAML files should be referred to by extension ".yml" (instead of ".yaml", if they have one).
Currently, any remaining use of the extension ".yaml" seems (in my view) slightly silly.
Commonly, the letter X is used for a great variety of meanings including "cross", "extensible", "variable", etc. (e.g. in XML). On the other hand, Y (e.g. in YML or YAML) carries no such extra baggage.
Relatively speaking, Y's use is rather uncommon. The acronym YACC comes to mind (for "Yet another compiler compiler"—BTW, its extension is simply ".y" when generating C language files). Actually, YACC assists more than it conflicts, because historically (as you may know) YAML was an acronym for the similar phrase, "Yet another markup language".
Linguistically speaking, therefore, the acronym "XML" has (in a way) only two informative letters. By contrast, all three of the letters of "YML" are fully informative. Indeed, the existing set of acronyms beginning with Y seems extremely small.
Per Wikipedia's article on information theory, "Abstractly, information can be thought of as the resolution of uncertainty." By implication, this is why a four letter YAML file extension feels greatly overspecified.
For the sake of completeness (though less important), this Ansible project comment (regarding their choice of extension) exemplifies other motivations:
> Three letter extensions owe historical relevance from DOS.
> They also save typing.
But these last two aren't the important reasons—instead, see above.
This comment (from March, 2014 in the Symphony project) also seems relevant:
> Once you have two of the biggest industry players doing ".yml" as the extension, it is the standard.
Information from the YAML.org website dates the organization's most recent activity to 2009 (approximately). Evidence of this comes from:
1. > © 2001-2006 YAML.org All Rights Reserved
2. > [The latest] News:
> 20-NOV-2011 -- JS-YAML, a JavaScript YAML parser by Alexey Zapparov and Vitaly Puzrin.
3. > [The latest] YAML Resources:
> YAML 1.2 (3rd Edition): http://yaml.org/spec/1.2/spec.html
Their latest specification (1.2 above) is from 2009, presumably before much of YAML's worldwide adoption:
> YAML Ain’t Markup Language (YAML™) Version 1.2
> 3rd Edition, Patched at 2009-10-01
Even their latest news item, the above-referenced JS-YAML, uses BTW the extension '.yml":
> var doc = require('/home/ixti/example.yml');
Therefore the staleness of YAML.org's information should greatly lessen the impact today from the recommendation in their FAQ:
> Is there an official extension for YAML files?
> FAQ
> 1. Please use ".yaml" when possible.
Here is a URL for web-searching the usage of the two YAML data file extensions (.yml and .yaml). I found time-wasting discussions of which extension to use here, here and here. Apparently these discussions are a result of the official organization exerting its influence uphill, against prevailing practice.
Maybe the public should complain. Maybe YAML.org would listen!
Here are merely some (of the many existing) usage examples of the shorter extension ".yml" in common use:
Per http://php-mysql-mvc.gajdaw.pl/instalacja/download/DoctrineExport.grt.lua:
> -- NOTES:
> -- 1. The YAML file extension usually is ".yml"
Per http://wiki.catalystframework.org/wiki/howtos/forms/formfu.view:
> NOTES:
> If you want a YAML file extension of .yaml (instead of .yml), you have to configure that.
Per https://code.google.com/p/javabuilders/issues/detail?id=114:
> The default YAML for most projects seems to be .yml, instead of .yaml.
> In NetBeans in particular, the YAML wizard only allows creating a file with a .yml extension
Per http://docs.doctrine-project.org/en/latest/reference/yaml-mapping.html:
> All mapping documents should get the extension ”.dcm.yml” to identify it as a Doctrine mapping file.
> $driver->setFileExtension('.yml');
> The Symfony project sponsored a driver that simplifies usage of the YAML Driver. The changes between the original driver are:
> File Extension is .orm.yml
> Filenames are shortened, “MyProject\Entities\User” will become User.orm.yml
> $driver->setGlobalBasename('global'); // global.orm.yml
> As a quick start, here is a small example document that makes use of several common elements:
> # Doctrine.Tests.ORM.Mapping.User.dcm.yml
Per http://www.fileinfo.com/extension/yaml:
> NOTE: YAML files more often use the .YML extension.
Per https://github.com/jasedit/rypple/issues/3:
> Configuration files should end in .yml, not .yaml
> That's the standard file ending, and should be consistent with expectations.
Per https://drupal.org/node/1935708:
> Posted by cweagans on March 6, 2013
> .info files are now .info.yml files
The only counterexample I have found (using ".yaml") comes from cPanel (in their EasyApache interface, apparently a cPanel product). Generally, cPanel seems somewhat "stuffy" and old-fashioned (i.e., likely to prefer the recommendation of an official organization over common usage). Per cPanel's EasyApacheHowToMoveProfiles:
> Profile are located in the /var/cpanel/easy/apache/profile/custom directory. The filename will be identical to the name you save it with, plus the .yaml file extension.
EDIT: The above reference is from the Wayback machine. However, as of August, 2016, we can still see cPanel using only extension ".yaml".
Copyright (c) 2013 Mark D. Blackwell.
Currently, any remaining use of the extension ".yaml" seems (in my view) slightly silly.
Commonly, the letter X is used for a great variety of meanings including "cross", "extensible", "variable", etc. (e.g. in XML). On the other hand, Y (e.g. in YML or YAML) carries no such extra baggage.
Relatively speaking, Y's use is rather uncommon. The acronym YACC comes to mind (for "Yet another compiler compiler"—BTW, its extension is simply ".y" when generating C language files). Actually, YACC assists more than it conflicts, because historically (as you may know) YAML was an acronym for the similar phrase, "Yet another markup language".
Linguistically speaking, therefore, the acronym "XML" has (in a way) only two informative letters. By contrast, all three of the letters of "YML" are fully informative. Indeed, the existing set of acronyms beginning with Y seems extremely small.
Per Wikipedia's article on information theory, "Abstractly, information can be thought of as the resolution of uncertainty." By implication, this is why a four letter YAML file extension feels greatly overspecified.
For the sake of completeness (though less important), this Ansible project comment (regarding their choice of extension) exemplifies other motivations:
> Three letter extensions owe historical relevance from DOS.
> They also save typing.
But these last two aren't the important reasons—instead, see above.
This comment (from March, 2014 in the Symphony project) also seems relevant:
> Once you have two of the biggest industry players doing ".yml" as the extension, it is the standard.
Information from the YAML.org website dates the organization's most recent activity to 2009 (approximately). Evidence of this comes from:
1. > © 2001-2006 YAML.org All Rights Reserved
2. > [The latest] News:
> 20-NOV-2011 -- JS-YAML, a JavaScript YAML parser by Alexey Zapparov and Vitaly Puzrin.
3. > [The latest] YAML Resources:
> YAML 1.2 (3rd Edition): http://yaml.org/spec/1.2/spec.html
Their latest specification (1.2 above) is from 2009, presumably before much of YAML's worldwide adoption:
> YAML Ain’t Markup Language (YAML™) Version 1.2
> 3rd Edition, Patched at 2009-10-01
Even their latest news item, the above-referenced JS-YAML, uses BTW the extension '.yml":
> var doc = require('/home/ixti/example.yml');
Therefore the staleness of YAML.org's information should greatly lessen the impact today from the recommendation in their FAQ:
> Is there an official extension for YAML files?
> FAQ
> 1. Please use ".yaml" when possible.
Here is a URL for web-searching the usage of the two YAML data file extensions (.yml and .yaml). I found time-wasting discussions of which extension to use here, here and here. Apparently these discussions are a result of the official organization exerting its influence uphill, against prevailing practice.
Maybe the public should complain. Maybe YAML.org would listen!
Here are merely some (of the many existing) usage examples of the shorter extension ".yml" in common use:
Per http://php-mysql-mvc.gajdaw.pl/instalacja/download/DoctrineExport.grt.lua:
> -- NOTES:
> -- 1. The YAML file extension usually is ".yml"
Per http://wiki.catalystframework.org/wiki/howtos/forms/formfu.view:
> NOTES:
> If you want a YAML file extension of .yaml (instead of .yml), you have to configure that.
Per https://code.google.com/p/javabuilders/issues/detail?id=114:
> The default YAML for most projects seems to be .yml, instead of .yaml.
> In NetBeans in particular, the YAML wizard only allows creating a file with a .yml extension
Per http://docs.doctrine-project.org/en/latest/reference/yaml-mapping.html:
> All mapping documents should get the extension ”.dcm.yml” to identify it as a Doctrine mapping file.
> $driver->setFileExtension('.yml');
> The Symfony project sponsored a driver that simplifies usage of the YAML Driver. The changes between the original driver are:
> File Extension is .orm.yml
> Filenames are shortened, “MyProject\Entities\User” will become User.orm.yml
> $driver->setGlobalBasename('global'); // global.orm.yml
> As a quick start, here is a small example document that makes use of several common elements:
> # Doctrine.Tests.ORM.Mapping.User.dcm.yml
Per http://www.fileinfo.com/extension/yaml:
> NOTE: YAML files more often use the .YML extension.
Per https://github.com/jasedit/rypple/issues/3:
> Configuration files should end in .yml, not .yaml
> That's the standard file ending, and should be consistent with expectations.
Per https://drupal.org/node/1935708:
> Posted by cweagans on March 6, 2013
> .info files are now .info.yml files
The only counterexample I have found (using ".yaml") comes from cPanel (in their EasyApache interface, apparently a cPanel product). Generally, cPanel seems somewhat "stuffy" and old-fashioned (i.e., likely to prefer the recommendation of an official organization over common usage). Per cPanel's EasyApacheHowToMoveProfiles:
> Profile are located in the /var/cpanel/easy/apache/profile/custom directory. The filename will be identical to the name you save it with, plus the .yaml file extension.
EDIT: The above reference is from the Wayback machine. However, as of August, 2016, we can still see cPanel using only extension ".yaml".
Copyright (c) 2013 Mark D. Blackwell.
Labels:
beauty,
complex,
computer,
computer language,
cPanel,
data entry,
ease,
education,
efficient,
error,
format,
linguistics,
natural language,
notation,
programming,
yaml
Wednesday, July 3, 2013
Use Ruby-like Mirah to develop for Android
I have minimal experience in Android development—I have set up its development environment and merely compiled something that another has written. I work mainly in Ruby on Rails.
However, for the intrinsic joy from developing something on an Android device, I'm particularly interested in the language Mirah created by Charles Oliver Nutter (the developer of JRuby). I keep Mirah in mind, for whenever it will become practicable to use in Android development.
Perhaps Mirah is ready now—a Google search shows plenty of people using Mirah on Android.
Back in 2011, Nutter wrote an article about Mirah in Dr. Dobb's Journal. To sum up, this is a Ruby-like language designed in such a way that, for any program feature (or user feature) a programmer desires to implement, she would create a new keyword or plugin for the language (somewhat directly in the compiler—this being Mirah's main point of departure) rather than add a new Java package. And, it compiles to the JVM.
Therefore in Mirah (unlike in JRuby-based approaches such as Ruboto) no program needs a package or library beyond what is already in standard Java and Android. Programs written in it are extremely tiny (due to running without huge, additional language libraries) and they load and run (both) extremely quickly on Android devices (with their Dalvik Java virtual machine).
To use Mirah to build an Android app, see the Pindah project.
In order for someone to use Mirah (essentially syntax sugar on top of Java) BTW not only should they be familiar with Ruby, but they must also know Java well.
There's more about Mirah here:
For Android development, other JVM languages, Scala, Clojure, etc., as well as Ruboto, are also interesting.
Various StackOverflow questions relate to Android development using Mirah, JRuby, Ruboto, etc.:
Copyright (c) 2013 Mark D. Blackwell.
However, for the intrinsic joy from developing something on an Android device, I'm particularly interested in the language Mirah created by Charles Oliver Nutter (the developer of JRuby). I keep Mirah in mind, for whenever it will become practicable to use in Android development.
Perhaps Mirah is ready now—a Google search shows plenty of people using Mirah on Android.
Back in 2011, Nutter wrote an article about Mirah in Dr. Dobb's Journal. To sum up, this is a Ruby-like language designed in such a way that, for any program feature (or user feature) a programmer desires to implement, she would create a new keyword or plugin for the language (somewhat directly in the compiler—this being Mirah's main point of departure) rather than add a new Java package. And, it compiles to the JVM.
Therefore in Mirah (unlike in JRuby-based approaches such as Ruboto) no program needs a package or library beyond what is already in standard Java and Android. Programs written in it are extremely tiny (due to running without huge, additional language libraries) and they load and run (both) extremely quickly on Android devices (with their Dalvik Java virtual machine).
To use Mirah to build an Android app, see the Pindah project.
In order for someone to use Mirah (essentially syntax sugar on top of Java) BTW not only should they be familiar with Ruby, but they must also know Java well.
There's more about Mirah here:
For Android development, other JVM languages, Scala, Clojure, etc., as well as Ruboto, are also interesting.
Various StackOverflow questions relate to Android development using Mirah, JRuby, Ruboto, etc.:
- include-ruboto-core-with-android-app-on-install
- using-mixed-java-ruby-code-in-an-android-app
- what-ruby-based-mobile-cross-platform-solution-to-use
- any-tutorial-like-articles-out-there-that-explain-how-to-use-jruby-on-android
- jvm-based-language-without-language-runtime
- ruby-on-android-ruboto-vs-rhodes
- ruby-practical-for-android-development
- sl4a-vs-ruboto-on-android-application-development
- best-way-to-set-up-an-android-emulator-on-linux-for-ruboto
Copyright (c) 2013 Mark D. Blackwell.
Tuesday, April 30, 2013
Essential jQUERY
Recently, I picked up the bare essentials in jQuery from the book, jQUERY Visual Quickstart Guide
by Steven Holzner, Peachpit Press, 2009.
However, a word of warning: the book is somewhat badly edited, and there is no corrected edition (still as of this writing).
From the core jQuery source code, this page also is useful. Here are my brief notes:
JQuery refers to a certain syntax
The keyword
The jQuery methods selected for explanation in the book are:
Copyright (c) 2013 Mark D. Blackwell.
However, a word of warning: the book is somewhat badly edited, and there is no corrected edition (still as of this writing).
From the core jQuery source code, this page also is useful. Here are my brief notes:
JQuery refers to a certain syntax
$(thing) for any thing as 'jQuery-wrapping'.The keyword
$ is an alias for jquery. Both are used in the following ways:$(function)– Append a function to the list to be run when the document is ready: a shortcut for$(document).ready(function).$(CSS-selector-string)– Select some nodes in the document.$(HTML-string)– Create HTML for insertion.$(DOM-node)– Like saying simplyDOM-node, but change the value ofthisand setcontext(an attribute used by jQuery). Examples are:-
$(document)– The document. -
$(this)– this.
-
$.method– (This one has a dot and no parentheses.) Run a utility method.
The jQuery methods selected for explanation in the book are:
- Methods on jQuery-wrapped collections of HTML elements:
- addClass, after, alt, animate, append, attr, before, bind, clone, css, each, (event binder methods), fadeIn, fadeOut, fadeTo, height, hide, hover, html, is, (jQuery-UI methods), length, load, one, serializeArray, show, size, slice, slideDown, slideToggle, slideUp, text, toggle, toggleClass, unbind, val, width, wrap
- Event binder methods:
- Keyboard – keydown, keypress, keyup
- Mouse – mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup
- The rest – beforeunload, blur, change, click, dblclick, error, focus, load, resize, scroll, select, submit, unload
- jQuery-UI methods:
- accordian, datepicker, dialog, progressbar, slider, tabs
- Methods on jQuery-wrapped HTML strings:
- insertAfter, insertBefore
- Utility methods:
- ajax, browser, each, get, grep, inArray, isArray, isFunction, makeArray, map, post, support, trim, unique
Copyright (c) 2013 Mark D. Blackwell.
Wednesday, November 7, 2012
Install Opa language on 32-bit Debian squeeze, howto
The coolest feature of the Opa web programming language is that it automatically divides developers' programs into server and client sides, compiling to JavaScript.
Though the Opa compiler (as of this writing) doesn't have a 32-bit binary for Windows, I got it working in an easy way on (32-bit) Debian squeeze, after upgrading my nodejs installation.
Following Opa's instructions to install as a user (under the heading, Other Linux Distribution), I downloaded and ran their 32-bit Linux self-extracting package. When prompted, I chose to install it into ~/progra/mlstate-opa.
Then, after navigating to A tour of Opa in the sidebar, under the heading, Easy Workflow, I found and typed into a file, 'hello.opa' their sample program. The command:
$ opa hello.opa --
errored out, asking for more npm modules to be installed.
Rather than exactly following their suggested course of action, which would have installed node modules to root-owned directories, I typed:
$ npm install mongodb formidable nodemailer simplesmtp imap
After that the compiler worked just fine.
Copyright (c) 2012 Mark D. Blackwell.
Though the Opa compiler (as of this writing) doesn't have a 32-bit binary for Windows, I got it working in an easy way on (32-bit) Debian squeeze, after upgrading my nodejs installation.
Following Opa's instructions to install as a user (under the heading, Other Linux Distribution), I downloaded and ran their 32-bit Linux self-extracting package. When prompted, I chose to install it into ~/progra/mlstate-opa.
Then, after navigating to A tour of Opa in the sidebar, under the heading, Easy Workflow, I found and typed into a file, 'hello.opa' their sample program. The command:
$ opa hello.opa --
errored out, asking for more npm modules to be installed.
Rather than exactly following their suggested course of action, which would have installed node modules to root-owned directories, I typed:
$ npm install mongodb formidable nodemailer simplesmtp imap
After that the compiler worked just fine.
Copyright (c) 2012 Mark D. Blackwell.
Thursday, February 16, 2012
Methods as first-class objects in Ruby, howto
Recently, I became interested in the general concept of methods as first-class objects in Ruby.
Often, this is useful because they delay their execution, beyond argument-list evaluation time.
Procs and lambdas exist, but I noticed that lambdas are slower than ordinary methods.
The following is a scheme for simply using modules as first-class method objects.
Here are some methods to pass around, using the scheme:
module Double def self.call(x) x*2 end end
module Triple def self.call(x) x*3 end end
double, triple = Double, Triple
You can invoke them in your Ruby code with a syntax similar to that of lambdas:
p triple.call 'a' #=> "aaa"
If you care about lambda's bracket syntax, you have to add:
module Triple instance_eval{alias :[] :call} end
p triple['a'] #=> "aaa"
Here's how to use this module scheme to pass methods as first-class objects:
double=Double
def using_module(m) m.call(1) end
using_module(double)
Some testing:
methods=[Double,Triple]
def take_both(source,m) m.call(source) end
a=[[1],'a'].product(methods).map{|source,method| take_both source, method}
p a #=> [[1, 1], [1, 1, 1], "aa", "aaa"]
Here are some of the alternatives:
module Methods def self.double(x) x*2 end end
def using_symbol(m) Methods.send(m,1) end
using_symbol(:double)
double=lambda{|x| x*2}
def using_lambda(m) m.call(1) end
using_lambda(double)
I tested the speed of the various alternatives (in the 1.9.3, 1.9.2 and 1.8.7 versions of Ruby).
The result? In 1.9.3, the scheme is about fifteen percent faster than passing symbols, which in turn is about twenty percent faster than lambdas.
Copyright (c) 2012 Mark D. Blackwell.
Often, this is useful because they delay their execution, beyond argument-list evaluation time.
Procs and lambdas exist, but I noticed that lambdas are slower than ordinary methods.
The following is a scheme for simply using modules as first-class method objects.
Here are some methods to pass around, using the scheme:
module Double def self.call(x) x*2 end end
module Triple def self.call(x) x*3 end end
double, triple = Double, Triple
You can invoke them in your Ruby code with a syntax similar to that of lambdas:
p triple.call 'a' #=> "aaa"
If you care about lambda's bracket syntax, you have to add:
module Triple instance_eval{alias :[] :call} end
p triple['a'] #=> "aaa"
Here's how to use this module scheme to pass methods as first-class objects:
double=Double
def using_module(m) m.call(1) end
using_module(double)
Some testing:
methods=[Double,Triple]
def take_both(source,m) m.call(source) end
a=[[1],'a'].product(methods).map{|source,method| take_both source, method}
p a #=> [[1, 1], [1, 1, 1], "aa", "aaa"]
Here are some of the alternatives:
module Methods def self.double(x) x*2 end end
def using_symbol(m) Methods.send(m,1) end
using_symbol(:double)
double=lambda{|x| x*2}
def using_lambda(m) m.call(1) end
using_lambda(double)
I tested the speed of the various alternatives (in the 1.9.3, 1.9.2 and 1.8.7 versions of Ruby).
The result? In 1.9.3, the scheme is about fifteen percent faster than passing symbols, which in turn is about twenty percent faster than lambdas.
Copyright (c) 2012 Mark D. Blackwell.
Labels:
computer language,
efficient,
first-class,
howto,
programming,
ruby,
syntax
Tuesday, January 10, 2012
Lisp & Ruby metaprogramming
I just reread Paul Graham's article, Beating the Averages, on Lisp being the most powerful computer programming language because of Lisp macros (which, BTW, are not like assembly language macros). It led me to the obvious perception that because Ruby lacks Lisp macros, metaprogramming in it is weaker than in Lisp.
He explains the essence of Lisp macros: '[I]n general, for application software, you want to be using the most powerful ...language you can get, and using anything else is a mistake. ...Lisp code, after it's read by the parser, is made of data structures that you can traverse. If you understand how compilers work, [in Lisp you] write programs in the parse trees that get generated within the compiler when other languages are parsed. But these parse trees are fully accessible to your programs. You can write programs that manipulate them. In Lisp, these programs are called macros. [P]ower ...refers to features you could only get in [a] less powerful language by writing an interpreter for [a] more powerful language in it.'
So, for someone who wants to know where to go next after Ruby, and thinks that, in a Ruby code base, having a high proportion of metaprogramming code, like some say Rails 3 has these days, results in awkwardness, the next step is Lisp. Lisp apparently is perhaps a better metaprogramming language.
Copyright (c) 2012 Mark D. Blackwell.
He explains the essence of Lisp macros: '[I]n general, for application software, you want to be using the most powerful ...language you can get, and using anything else is a mistake. ...Lisp code, after it's read by the parser, is made of data structures that you can traverse. If you understand how compilers work, [in Lisp you] write programs in the parse trees that get generated within the compiler when other languages are parsed. But these parse trees are fully accessible to your programs. You can write programs that manipulate them. In Lisp, these programs are called macros. [P]ower ...refers to features you could only get in [a] less powerful language by writing an interpreter for [a] more powerful language in it.'
So, for someone who wants to know where to go next after Ruby, and thinks that, in a Ruby code base, having a high proportion of metaprogramming code, like some say Rails 3 has these days, results in awkwardness, the next step is Lisp. Lisp apparently is perhaps a better metaprogramming language.
Copyright (c) 2012 Mark D. Blackwell.
Labels:
agile,
business,
compiler,
computer,
computer language,
data structure,
ease,
education,
efficient,
language,
lean startup,
lisp,
programming,
Rails,
Rails 3,
ruby,
startup,
syntax
Thursday, September 22, 2011
Learn You a Haskell for Great Good!
Following is a note I wrote to the author of a wonderful book:
Hi, Miran Lipovača,
Thanks for your wonderful, _Learn You a Haskell for Great Good!_. Just now, I am resuming reading it, after completing a project (in another language).
For many people, it is important to be refreshed by beauty, as of mathematics in your book!
Copyright (c) 2011 Mark D. Blackwell.
Hi, Miran Lipovača,
Thanks for your wonderful, _Learn You a Haskell for Great Good!_. Just now, I am resuming reading it, after completing a project (in another language).
For many people, it is important to be refreshed by beauty, as of mathematics in your book!
Copyright (c) 2011 Mark D. Blackwell.
Labels:
_why,
_why the lucky stiff,
book,
computer,
computer language,
education,
haskell,
intuitive,
language,
mathematics,
programming,
writing
Sunday, February 20, 2011
Installing Prolog on Puppy Linux, howto
From the book, Seven Languages in Seven Weeks, I notice a trend toward specialty languages being glued together by Ruby, or any scripting language. We can use the right tool for the right purpose instead of one "sledgehammer" only! Some examples are Prolog for rules (or logic) and Io (w/s "io language") for parsing.
Today I installed the package SWI Prolog, useful for developing in Prolog, the logic computer programming language, on a computer running Puppy Linux (Quirky Retro 1.2).
Here's how I did it:
o From Debian.org, download two 'lenny' packages:
swi-prolog_5swi-prolog_5.6.58-2_i386.deb
libgmp3c2_4.2.2+dfsg-3_i386.deb
o In the ROX-Filer file manager, click their icons to install them.
o Create a file, ~/.plrc containing the single line:
:- set_prolog_flag(editor,'geany').
o Within ~/my-documents, create and change to the directory, 'prolog'.
o Associate the file extension, '.pl' with SWI Prolog. Create a file like 'any.pl'. Right-click it in ROX-Filer and edit the run command to be:
urxvt -e swipl -s "$@"
Now you can click on a file with extension '.pl' and it will be loaded by the interpreter.
To make changes, type, 'edit.'. The interpreter will re-read the file when you close the editor. Type 'halt.' to end the session.
One example to get you started: if you type 'alice.' into a file, and in the interpreter type 'alice.', it will respond with, 'true'.
For further information, the SWI Prolog user manual is available off-line at:
file:///usr/lib/swi-prolog/doc/Manual/index.html
Their FAQ is:
http://www.swi-prolog.org/FAQ/
Some tutorials appropriate to beginners:
http://www.bitwisemag.com/copy/programming/prolog/intro/firststeps.html
http://www.learnprolognow.org/
http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/contents.html
http://www.doc.gold.ac.uk/~mas02gw/prolog_tutorial/prologpages/
Copyright (c) 2011 Mark D. Blackwell.
Today I installed the package SWI Prolog, useful for developing in Prolog, the logic computer programming language, on a computer running Puppy Linux (Quirky Retro 1.2).
Here's how I did it:
o From Debian.org, download two 'lenny' packages:
swi-prolog_5swi-prolog_5.6.58-2_i386.deb
libgmp3c2_4.2.2+dfsg-3_i386.deb
o In the ROX-Filer file manager, click their icons to install them.
o Create a file, ~/.plrc containing the single line:
:- set_prolog_flag(editor,'geany').
o Within ~/my-documents, create and change to the directory, 'prolog'.
o Associate the file extension, '.pl' with SWI Prolog. Create a file like 'any.pl'. Right-click it in ROX-Filer and edit the run command to be:
urxvt -e swipl -s "$@"
Now you can click on a file with extension '.pl' and it will be loaded by the interpreter.
To make changes, type, 'edit.'. The interpreter will re-read the file when you close the editor. Type 'halt.' to end the session.
One example to get you started: if you type 'alice.' into a file, and in the interpreter type 'alice.', it will respond with, 'true'.
For further information, the SWI Prolog user manual is available off-line at:
file:///usr/lib/swi-prolog/doc/Manual/index.html
Their FAQ is:
http://www.swi-prolog.org/FAQ/
Some tutorials appropriate to beginners:
http://www.bitwisemag.com/copy/programming/prolog/intro/firststeps.html
http://www.learnprolognow.org/
http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/contents.html
http://www.doc.gold.ac.uk/~mas02gw/prolog_tutorial/prologpages/
Copyright (c) 2011 Mark D. Blackwell.
Labels:
computer,
computer language,
howto,
install,
language,
linux,
programming,
prolog,
Puppy,
swi-prolog,
unix
Subscribe to:
Comments (Atom)