O meni:

Sem še relativno mlad (v '30 letih) inženir informatike iz Ljubljane. Teme, ki me najbolj zanimajo: dogodki po svetu (novice, politika), zgodovina, znanost (sploh vesolje)

ABC in Python: dva lahka programska jezika

No in pa še ena objava v povezavi samo z računalniškimi zadevščinami (če sem natančen je to že peta po vrsti, mislim pa, da za nekaj časa tudi zadnja), v njej pa bom pisal o programskih jezikih imenovanih ABC (o tem bom pisal malo bolj obširno) in Python (o tem pa čisto na kratko), s katerima sem se seznanil že kar nekaj časa nazaj (z enim bolj, z drugim manj) in katera sta res idealna za učenje osnov (zato tudi beseda “lahka” v naslovu objave) programiranja. Tu še posebej mislim na jezik Python, kajti z njim lahko vidno napreduješ iz dneva v dan in ti zlepa ne zmanjka “snovi” za učenje, sami programi napisani v njem pa so uporabni v marsikaterem področju računalništva. Oba programa pa sta tudi “interaktivna”, s tem mislim na to, da z njima delaš v command-promptu in rezultate posameznih funkcij/ukazov vidiš sproti.

1. Prvi, ki sem ga omenil zgoraj je bolj kot ne poskusni programski jezik imenovan ABC: http://homepages.cwi.nl/~steven/abc, kljub dejstvu, da je samo “poskusni” pa ima kar nekaj prednosti oz. posebnosti. Za kratek pregled jezika si lahko zdownloadate in preletite .pdf falj ABC-Newsletter-7.pdf, ki sem ga v ta namen (da si ga vi, obiskovalci mojega bloga lahko preberete) zuplodal na moj Volja FTP server.

In pa dalje, 7.3.2005 sem v events1.html dokumentu pod “events” sekcijo na moji glavni “PC domači strani” o programu napisal tale tekst spodaj. O njem sem tudi odprl topic na “Ars OpenForum” forumu pod “Programmer’s Symposium” sekcijo, link pa je v že omenjenem tekstu takoj tule spodaj.

I’ve just discovered a new programming language and environment for personal computers. It’s called simply ABC, it has a collection of only 5 data types and it was originally intended as a replacement for BASIC. It was designed by first doing a task analysis of the programming task. See the topic that I’ve opened on Ars Technica titled ABC programming language: Ars Technica 12 x 12 pixels icon http://episteme.arstechnica.com/…/101000412731, but also check the ABC’s homepages with clicking on this link here: http://homepages.cwi.nl/~steven/abc, then here: http://homepages.cwi.nl/~steven/abc/implementations.html, here: http://www.answers.com/topic/abc-programming-language, and finally here: http://www.cwi.nl/archive/projects/abc.html.

Some features of the language (from the program’s homepage):

a powerful collection of only 5 data types that can easily be combined strong typing, yet without declarations no limitations (such as max int), apart from sheer exhaustion of memory refinements to support top-down programming nesting by indentation programs typically one fourth or one fifth the size of the equivalent Pascal or C.

Some features of the environment (from the program’s homepage):

no need for files: procedures and functions and global variables remain after logging out one consistent face is shown to the user at all times, whether executing commands, editing, or entering input to a programs generalized undo mechanism.

I have become quite familiar with it in the last month. The whole .zip package is only 605 kB in lenght, and oh yeah – this one also comes without an installer (compare to Python or Ruby), so you only need to do two very simple things. First you need to edit a few lines in the “abc.bat” file (it’s used to launch the ABC’s “workspace”, i.e. interpreter), and second you need to edit the ABCxp.lnk shortcut’s properties to corespond to your particular situation. Hehe yes, that’s why I also call my Linux Slackware (Zipslack) distribution a “non-setup” operating system, i.e. because you only need to edit one line in the linux.bat file (the “root=/dev/XXXX” one in particular), to boot to the correct partition where Linux is located.

2. Kot drugo pa bom, bolj na kratko sicer, omenil tudi veliko bolj znan programski jezik imenovan Python: http://www.python.org, ki je t.i. skriptni jezik, uporaben predvsem oz. tudi pri webkoding-u. Konkretno Python-u sem se posvetil veliko bolj kot ABC-ju in sem v njem napisal kar nekaj bolj ali manj uporabnih programov. Mimogrede, programski jezik se imenuje Python po skupini “Monty Python“, vseeno pa kot ikonco uporabljajo glavo od kače Piton.

Na Python-ovi domači spletni strani (za link glej en odstavek zgoraj) je programski jezik opisan takole.

Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. Many Python programmers report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code.

Python runs on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm Handhelds, and Nokia mobile phones. Python has also been ported to the Java and .NET virtual machines.

Python is distributed under an OSI-approved open source license that makes it free to use, even for commercial products.

The Python Software Foundation (PSF) holds and protects the intellectual property rights behind Python, underwrites the PyCon conference, and funds grants and other projects in the Python community.

Read more -or- try Python now

Medtem pa kot v programovem “README.txt” fajlu Python-a opišejo tako. Tekst sem sicer malo lepše sformatiral in pa tudi linke sem spremenil v dejanske “clickable” linke; ta fajl je namreč navaden .txt fajl, ki seveda ne podpira HTML formatiranja.

What is Python anyway?
———————-

Python is an interpreted object-oriented programming language suitable (amongst other uses) for distributed application development, scripting, numeric computing and system testing. Python is often compared to Tcl, Perl, Java, JavaScript, Visual Basic or Scheme. To find out more about what Python can do for you, point your browser to http://www.python.org/.

How do I learn Python?
———————-

The official tutorial is still a good place to start; see http://www.python.org/doc/ for online and downloadable versions, as well as a list of other introductions, and reference documentation.

There’s a quickly growing set of books on Python. See http://www.python.org/cgi-bin/moinmoin/PythonBooks for a list.

Ali kot piše še nekje drugje: “Python, an interpreted, interactive, object-oriented, extensible programming language. It provides an extraordinary combination of clarity and versatility, and is free and comprehensively ported.” (opazite dodaten pridevnik “interactive”??), kar je nekako najbolj jedrnat opis tega programskega jezika!!

Seveda je pa na žalost tako, da je potrebno imeti za zagon le-teh (bajdvej, njihov extension je .py, je pa to čisto navaden .txt fajl) inštaliran program/paket Python na samem računalniku, kjer naj bi se jih zagnalo. No ja, če se prav spomnim obstaja tudi nek dodatek k programu, ki te .py fajle (ki kot rečeno potrebujejo Python-a za njih uporabo) skompajlajo v .exe fajl, a se meni s tem ni dalo ukvarjati. Če pa bi kdaj napisal kak program za koga drugega, pa bi se pač toliko že potrudil.

Tadej

Advertisements

3 komentarji on “ABC in Python: dva lahka programska jezika”

  1. ruph pravi:

    programerske vode, ha? kul. Ustvari kaj koristnega! 😉

  2. tadej pravi:

    Hehe, ja ruph, se bom potrudil (ustvariti kaj koristnega), drugače pa naj še enkrat povem, da sem se z ABC-jem bolj samo igračkal, medtem ko pa sem se Python-u kar resno posvetil. Tako da ja, čeprav je od takrat že kar nekaj cajta minilo, mislim, da sem vseeno še vedno sposoben sprogramirati kakšen kolikor toliko koristen programček.

    Tadej

  3. tadej pravi:

    Aja in pa za ostale bralce še opomba, da sem v objavo dodal tudi opisa Python-a in to enega iz njegove domače strani, drugega pa iz njegovega “README.txt” fajla. Tako da vam skratka toplo priporočam, da si preberete tudi ta na novo dodan tekst.

    Tadej


Oddajte komentar

Fill in your details below or click an icon to log in:

WordPress.com Logo

Komentirate prijavljeni s svojim WordPress.com računom. Odjava / Spremeni )

Twitter picture

Komentirate prijavljeni s svojim Twitter računom. Odjava / Spremeni )

Facebook photo

Komentirate prijavljeni s svojim Facebook računom. Odjava / Spremeni )

Google+ photo

Komentirate prijavljeni s svojim Google+ računom. Odjava / Spremeni )

Connecting to %s