Post Reply 
What Was Your First Programming Language?
07-08-2015, 12:39 AM
Post: #67
RE: What Was Your First Programming Language?
(07-07-2015 02:26 PM)Bill (Smithville NJ) Wrote:  PROLOG - I have played with several versions of this language over the years, but never used it for any particular project. Has anyone here used this for a production project?

I used Prolog (along with some Perl) to write an expert system which could reason about information risk, as part of my Masters project. It worked by building a knowledge base from the Mitre & NIST CPE (Common Platform Enumeration) and CVE (Common Vulnerabilities and Exposures) databases, then adding information about enterprise information assets in order to discover exposures and ultimately work out the unmitigated and mitigated risks.

It wasn't very polished, and the reason I chose Prolog was, in part, to get more experience with a purely declarative programming language. I'd tried to use it once before, and it just about did my head in, so steeped was I in procedural programming style. This time around, it seemed to go a lot easier - but when I tackled an assignment in OCaml, an object-oriented functional programming language, for much the same reason, I found it equally mind-bending. Wink

(07-07-2015 02:26 PM)Bill (Smithville NJ) Wrote:  ADA - Another one that I played with a little using AGUSTA which was a subset of ADA. AGUSTA is interesting in that it is written in Turbo Pascal, so you can play around with the Compiler and Interpreter. Has anyone here had experience with ADA?

I used the Janus compiler for x86, but not for anything serious. Here's an Ada implementation of the classic number guessing game that I wrote at the time:

Code:

Package Body guess Is
    Number,Guess : Integer;
    Name : Array (1..30) of Character;
    Play : Character;
    Gen : Float;
    Root : constant := 0.211327;

    Procedure Random (n : In Out Integer) Is
        Temp : Float;

        Begin
            Temp := 9821 * Gen + Root;
            Gen := Temp - Integer(Temp);
            n := Integer(100 * Gen);
        End Random;

    Begin
        Gen := Root;
        New_line;
        Put("Hi, there, what is your name ? ");
        Get(Name); Skip_line;
        Put("OK "); Put(Name); New_line;
        Put("Do you want to play a guessing game ? ");
        Get(Play); Skip_line;
        While (Play = "Y") Or (Play = "y") Loop
            New_line;
            Random(Number);
            Put("I am thinking of a number between 1 and 100");
            New_line;
            Put("What is your guess ? ");
            Get(Guess); Skip_line;
            While Guess /= Number Loop
                If Guess > Number Then
                    Put("Too high"); New_line;
                Else
                    Put("Too low"); New_line;
                End If;
                Put("What is your guess ? ");
                Get(Guess); Skip_line;
            End Loop;
            Put("You got it , "); Put(Name); New_line;
            Put("Do you want to play again ? ");
            Get(Play); Skip_line;
        End Loop;
        Put("Good Bye, "); Put(Name); New_line;
    End guess;

I didn't mind Ada too much, but it didn't seem to do anything for me that I couldn't do with DRI's PL/I Subset G, which I was using heavily at that time, so I didn't pursue it. As support for PL/I disappeared, I switched to C and C++, which I'd been using for other projects, and then the Operating Systems Wars of the 1990's (OS/2 vs Windows, etc.) made me vow never to write anything non-portable ever again, so I switched to Java, which I still use extensively for simulations and crypto work.

This coming semester I will once again be teaching a class (e-Commerce Technologies) in which the students will be using PHP. Shoot me now, please. . .

--- Les
[http://www.lesbell.com.au]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: What Was Your First Programming Language? - Les Bell - 07-08-2015 12:39 AM



User(s) browsing this thread: 1 Guest(s)