Sunday, October 7, 2012

LOL



"I program in lolcode" - Chuck Norris

“ToyScript is great for the demo, but the problem is that people haven’t heard of it. 
Wouldn’t it be cool to find an existing language and implement that? 
Oh, have you heard of LOL Code?” - John Lam

"Ahm...LOL" - Me

          A good programmer knows the power he owns depends on the awesomeness of his/her programming skills and the capabilities of his/her programming language of choice. If you know C and Java, you can probably say that you are awesome enough because you know the foundations of high level programming. However, what you lack is the awesome and fun experience of writing superior computer programs in internet/meme language. Combine the power of a high level programming language and the fun of internet language and what do you get? - LOLCODE. LOLCODE is the brainchild of programmer Adam Lindsay, at the Computing Department of Lancaster University. It is an esoteric programming language and is tested as a Turing-complete language. LOLCODE statements are derived from the lolcat meme which ultimately violates English grammar but perfectly conforms to the humor of the contemporary netizens. LOLCODE is supported by many hardcore programmers and they contribute to its instruction to starters. For example there is an online LOLCODE environment to teach syntax and LOLCODE structure to beginners using programming challenges. There many online forums that bring LOLCODE programmers together and share knowledge to improve the language.

      The first LOLCODE implementation was a PHP parser written by Jeff Jones. There is also a .NET compiler for LOLCODE written by Nick Johnson. PL/LOLCODE, a project headed by Josh Tolley, makes LOLCODE available as a server-side programming language inside PostgreSQL. A LOLCODE to JavaScript translator is also available. LOLCODE is as versatile as python so Andrew Dalke created a dialect of python called LOLPython. LOLPython uses LOL-inspired syntax similar to that of LOLCODE, but with a Python-like style. It operates by translating the LOLPython source into Python code. By the way, LOLCODE uses another esoteric programming language for its compiler called Brainf*ck.

Sample "Hello World" program:







References:
http://en.wikipedia.org/wiki/Lolcode#cite_note-10
http://lolcode.com/articles/dlr-intro
http://www.tetraboy.com/lolcode/
http://forum.lolcode.com/
http://beerpla.net/2008/12/16/the-ultimate-programming-language-lolcode/

Authors:
Ornales, John Gabrielle 
Escobar Frederick
CMSC 124 T2L


Prolog: Mother of Erlang





PROLOG
Mother Of Erlang

"Prolog (PROgramming in LOGic) is a logic programming language developed by Alain Colmerauer and Phillipe Rousel that is quite similar to Erlang. It is a rich collection of data structures in the language and human reasoning and a powerful notation for encoding end-user applications. It has its logical and declarative aspects, interpretative nature, compactness and inherent modularity."

Prolog is one of the most widely used programming languages in artificial intelligence research. As opposed to imperative languages such as C or Java (which also happens to be object-oriented) it is a declarative programming language. That means, when implementing the solution to a problem, instead of specifying how to achieve a certain goal in a certain situation, we specify what the situation (rules and facts) and the goal (query) are and let the Prolog interpreter derive the solution for us. Prolog is very useful in some problem areas, such as artificial intelligence, natural language processing, databases, but pretty useless in others, such as graphics or numerical algorithms.

THE HUMBLE BEGGININGS OF PROLOG




Alain Colmerauer

Prolog is the programming language developed by Alain Colmerauer and Phillipe Roussel in the summer of 1972. The name was suggested by Roussel’s wife, Jacqueline, as an abbreviation for programmation en logique. It was influenced by Planner, also a logic programmong language and was created to represent logic in a declarative, procedural manner. Today Prolog is also used in the field of theorem proving,expert systems, games etc some variations of prolog have evolved since the creation of  the original version. Up to this day prolog is still widely used, ISO Prolog Standardisation(1995) was  founded to ensure that the core of the language was still fixed.

What people say about PROLOG:



 In  the  eyes of  most  North  American  researchers  in AI,  resolution  had  long  been discredited. 
The fashion  had  turned.  . . toward  the  procedural  representation  of knowledge  and domain- 
specific  problem  solvers. - Robert A Kowalski






 To the extent that anyone but a Prolog programmer can understand \X totally. And to the extent that a Prolog programmer can understand 'cut'. - Larry Wall




I have used Prolog for my Masteral Thesis for AI programming. It’s a powerful language to use, especially for AI purposes - Sir Mercado

Since we did not touch logic programming as a topic in CMSC 124, I think Prolog will be a challenging and interesting language to learn even if its ancient.” - 2010-19833

 Prolog reminds me so much of Erlang. I like concept of Prolog being a logical programming language wherein it applies techniques that were actually designed to prove theorems using logic and therefore could implement all algorithms rather than it solving only those problems that it was specially designed to solve. -2010-04510

 Everything is a hypothesis. - Prolog. :P

Based on our research, I think Prolog would be very challenging to take. Although it is similar with Erlang, Prolog is used for AI which may be advanced when taken in CMSC124. But I guess it would be very interesting to study and practice.” 
-2009-00288


HoW To PrOgRaM iN PrOLoG...

Hello World:
            
            write(‘Hello world!’), n1.


Factorial:

               factorial(0,1).

       factorial(A,B) :- A > 0, C is A-1,

       factorial(C,D), B is A*D.


String Concatenation: 




References:

                    Kowalski, R. A.. The Early Years of Logic Programming.

                    http://www.deransart.fr//prolog/overview.html

                    http://alain.colmerauer.free.fr/

                    http://www.mta.ca/~rrosebru/oldcourse/371199/prolog/history.html

                    http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2.html

                    http://groups.engin.umd.umich.edu/CIS/course.des/cis479/prolog/bench.pro


CMSC 124 T-1L

MEMBERS:                    
                   2010-19833
                   2010-19873
                   2010-08886
                   2010-04510
                   2009-00288


Saturday, October 6, 2012



Velato... fa sol la si... dooooooo!!! >_<




A one of a kind.. musical programming language... anyone?
A lot of people love music. Some people say, without music you won't be able to find love. People might think that if you're a computer scientist, your only concern is the computer or when you say keyboard, it means a computer keyboard and not the one that outputs sounds or perform music. But according to Peter Kirn (composer/musician, media artist, educator, and technology writer, and the creator and editor of Create Digital Music), even before the term "IT" was coined in, most computer programmers have a musical background. *ehem
Some computer scientists love music to the point that they created a computer language that uses MIDI files as a source code, where programs are defined by the pitch and order of notes and (obviously) intended for music lovers (composers). Its primary goal is for flexibility in composition making functional programs don't sound like random notes.
Velato is an example of an esoteric programming language. It was created by User:Rottytooth (Daniel Temkin) in the year 2009.
They say that the results sound a "...a bit like an academic-sounding ragtime..." If you're going to listen to the outputs, well... they actually do sound like it was generated by a computer.
This is a computer language just for composers and composer wannabes. haha... nice.


What do other people say about Velato?

"I think its Hello World program is more listenable than the one for Fugue" -- Andy Baio
"Velato: What if Musical Notes Had Their Own Programming Language?" -- Peter Kirn
"It's an esoteric language, not designed for practical, every-day use (although don't let me discourage you from writing production code with it!). I was inspired to write it, in part, by Piet, but also an audio equivalent. I figured it offers an unusual challenge: to write something that both sounds musical and works as a program." -- Rottytooth (the creator himself to RustyBrooks)
"I think this sounds pretty cool. Nice work :)" -- johnstein
"(wide-eyed, after staring at the code for a few minutes)... So far, this (the program) is readable to me." -- scimtar

COMMANDS 
CommandSecond noteThird noteFollowed by / Notes
Change Root NoteMajor 2ndNew root note
Let (assignment)Minor 3rdVariable as single note, then expression
Declare variableMinor 6thVariable as single note, then type
BlocksMajor 3rd
WhileMajor 3rdExpression
End WhilePerfect 4th
IfPerfect 5thExpression
ElseMajor 6th
End IfMajor 7th
Special CommandsMajor 6th
Print to screenPerfect 5thExpression to print
(Table 1 from http://esolangs.org/wiki/Velato)

"Commands can be followed by any number of expressions. Notes used for expressions don't differentiate between major/minor or perfect/diminished. To avoid ambiguity, no augmented intervals can be used. So a tritone is always interpreted as a diminished 5th, not an augmented 4th."

ExpressionFirst noteSecond noteThird noteFollowed by / Notes
value3rd
variable2ndName of variable (single note)
pos. (+) int5thSingle note for each digit, ending with Perfect 5th to mark end of number
neg. (-) int3rdSingle note for each digit, ending with Perfect 5th to mark end of number
char4thChar as ASCII int: single note for each digit, ending with Perfect 5th to mark end of number
pos. (+) double6thSingle note for each digit, first Perfect 5th to mark decimal point, second Perfect 5th marking end of number
neg. (-) double7thSingle note for each digit, first Perfect 5th to mark decimal point, second Perfect 5th marking end of number
conditional2nd
=2nd
>3rd
<4th
NOT5thAlso used for NOT < (indicating greater than or equal to) and NOT =
AND6th
OR7th
procedural6th
grouping6th
(6th
)2nd
math operation5th
simple5th
+3rd
-2nd
*5th
/4th
% (mod)6th
exponential / other7th
power2nd
log3rd
(Table 2 from http://esolangs.org/wiki/Velato)
Types:
int = 2nd
char = 3rd
double = 4th

Sample Hello World program in Velato

(image from http://esolangs.org/wiki/Velato)

You can find the tutorial here at this link ---> http://danieltemkin.com/Blog/post/Velato-Hello-World!-tutorial.aspx
You can hear the code at this link ---> http://www.muziboo.com/mp3/hello-world-in-velato-programming-language-0/ 
Enjoy!

Sources:
http://esolangs.org/wiki/Velato
http://createdigitalmusic.com/staff/peter/
http://danieltemkin.com/Velato.aspx
http://projects.metafilter.com/1903/Velato-A-music-programming-language


Author:
Janroe Ryan A. Atienza
CMSC 124 T-3L

Friday, October 5, 2012

MAXIMA!



MAXIMA

Computer Algebra System






          Maxima is a system for the manipulation of symbolic and numerical expressions, including differentiation, integration, Taylor series, Laplace transforms, ordinary differential equations, systems of linear equations, polynomials, and sets, lists, vectors, matrices, and tensors. Maxima yields high precision numeric results by using exact fractions, arbitrary precision integers, and variable precision floating point numbers. Maxima can plot functions and data in two and three dimensions.

History:

          Maxima is based on a 1982 version of Macsyma, which was developed at MIT with funding from the United States Department of Energy and other government agencies. A version of Macsyma was maintained by Bill Schelter from 1982 until his death in 2001. In 1998, Schelter obtained permission from the Department of Energy to release his version under the GPL. That version, now called Maxima, is maintained by an independent group of users and developers. Maxima does not include any of the many modifications and enhancements made to the commercial version of Macsyma during 1982–1999. Though the core functionality remains similar, code depending on these enhancements may not work on Maxima, and bugs which were fixed in Macsyma may still be present in Maxima, and vice-versa.

Implementation:

print("Hello, world!")$ /* Hello World Implementation in Maxima */
a*x^4+b*x^3+c*x^2+d*x+e=0;
solve(%, x); /* Solving a Equation: */


Interface:

          Various graphical user interfaces are available for Maxima. wxMaxima is a popular cross-platform GUI using wxWidgets. Starting with version 4.4, the KDE Software Compilation contains Cantor-- which can interface with Maxima (along with SageR, and Kalgebra).[2] The GNU TeXmacs and LyX mathematical editor programs can be used to provide an interactive GUI for Maxima, as can Sage. Other options include the Imaxima front end, as well as an Emacs and Xemacs interaction mode which is activated by Imaxima.

Group's Insights:

          Maxima is taught in UPLB to CMSC150 students and it is used to program problems regarding systems of equations and stuffs. It is like a super calculator that has the ability to solve various difficult problems that a normal scientific calculator cannot. -Rainier Punzalan
          Maxima is really helpful to students especially in CMSC 150. It can solve the unknowns of n-equations,plot the points easily, modify larger polynomials, and others. It can also be used by   anybody because it is an open-source. -Bambi Rivera
          Maxima is very helpful in computing mathematical functions or equations, especially on those that are difficult to compute manually. -Chester Emia

Our CMSC 150 instuctor's insight:
          "You can easily edit your code with maxima because it is compatible with any text editor.  In terms of its functionalities, it can render 3-dimensional graphs so it is more advantageous than other computer algebra system. It also has an user interface. We used Maxima as the language to be used by our students in CMSC150 because it is the best applicable system with the exercises and problem sets we give and discuss. "
                                                                                                      -Ma'am Maan Clariño

References:

Group Members:
- Rainier Paolo Punzalan
- Bambi Erika Rivera
- Chester Emia
CMSC 124 T-8L 

Let's do the LIMBO




The Limbo Programming Language


I.                    Introduction
Limbo is a programming language intended for applications running distributed systems on small computers. It supports modular programming, strong type checking at compile and run-time, inter-process communication over typed channels, automatic garbage collection, and simple data types. It is designed for safe execution even on small machines without hardware memory protection.

In its initial implementation for the Inferno operating system, object programs generated by the Limbo compiler run using the interpreter for a fixed virtual machine. Inferno and its accompanying virtual machine run either stand-alone on bare hardware or as an application under conventional operating systems like Unix, Windows 95, Windows NT and Plan 9.

II.                  Programming Language Overview
Limbo have similarities to JAVA, this was produced by Sean Doward, Phil Winterbottom and Rob Pike. It is similar not only in terms of its strong typing, dynamic loading, automatic garbage collection, but also it compiles a program into a machine independent byte code for execution on a virtual machine.

Limbo program is a set of modules that cooperate to perform a task that was intended to be used in Inferno, which emphasizes networking and graphical interfaces.

a.       Modules
A module consists of a module declaration that specifies the public interface, the functions, abstract data types, and constants that the module makes visible to other module and an implementation that provides the actual code.

b.      Functions and Variables
Functions are associated with specific modules, either directly or as members of abstract data types within a module. Functions are visible outside their module only if they are part of the module interface.

c.       Data Types
Limbo provides abstract data types such as byte, int, big and real. It also provides Unicode strings, arrays of arbitrary types, lists of arbitrary types, tuples, reference types and typed channels. It provides automatic garbage collection, so there is no nedd to free dynamically created objects.

d.      Operators and Expression
Limbo provides many operators that are used in C programming language, but there is no ?: operator,  and ++ and – can only be postfix. Pointers created with ref, are very restricted and there is no &(address of) operator; there is no address arithmetic and pointers can only point to adt objects. Array slicing is supported, however, and replaces many pointer constructions.

e.      Statements
Statements and control flow in Limbo are similar in those in C. There is also case statement analogous to switch in C. A break or continue as well as the exit statement is also used. Comments in Limbo begin with # and extend until the end of the line.

f.        Libraries
This programming language has a small but still growing set of standard libraries, each implemented as a module.

III.                Features
a.       Exception Handler
Various errors in Limbo program can be detected only at run time. These include programming errors such as an attempt to index outside the bounds of an array, system errors such as exhausting memory, and user-defined exceptions declared at compile-time by exception declaration and caused at run-time by the raise statement.

b.      Scope
  The scope of an identifier is the lexical range of a program throughout which the identifier means a particular type of, or instance of, an object. the same identifier may be associated with several different objects in different parts of the same program

c.       Type Equality and Compatibility
  In an assignment and in passing an actual argument to a function, the types of the target and the expression being assigned or passed must be equal (with certain exceptions, e.g. assignment of nil to a referenced type).

d. Forward Referencing
   In general, names must be declared before they are used. the first exception to this rule is that a function local to a module need not have a declaration at all; it is sufficient to give its definition, and that definition may appear anywhere in the module.

IV.                Sample Codes

Hello World Program in Limbo  
       
implement Command;
include “sys.m”;
    sys: Sys;                          
include “draw.m”;
include “sh.m”;
init (nil: ref Draw -> Context nil: list of string)
{
    sys = load Sys Sys-> PATH;
    sys->print(“Hello World! \n”);
}


V.                  References

VI.                Members
     Email Address: cmsc124.t5l.limbo@gmail.com
     CMSC 124 (T-5L)
  •      2010-28910 ALIGORA, Jerome Oliver R. 
  •      2010-43728 ALMONTE, Joseph Conrad N.
  •      2010-61438 ARTANA, Jayson A.
  •      2010-27006 MENDOZA, Rinno Adam P.