SICP in Python

nikon-small-world-glycerin-based-soapy-solution
Cosa non si trova ontehtoobz!
Recentemente José Alonso posta questo cinguettio: SICP (Structure and Interpretation of Computer Programs) in Python.
Non è una novità assoluta, l’ho anche inserito nella pagina dei manuali di OKp: Composing Programs.
Ma siccome SICP è uno dei miei tormentoni preferiti oggi guardo e riferisco. Viene da uno corso (uno di quelli iniziali) per gli informatti, giù a Berkeley. Seguendo i link si trovano cose interessanti, p.es.:

This semester, 61A will be taught using the Python 3 programming language. Python is a popular language in both industry and academia. It is also particularly well-suited to the task of exploring the topics taught in this course. It is an open-source language developed by a large volunteer community that prides itself on the diversity of its contributors.

In previous semesters, this course was taught using the Scheme language, a dialect of Lisp, which itself dates back to 1958, making it the second-oldest “higher-level” programming language that is still in use (after Fortran). Lisp and Python are similar in many ways. In fact, Lisp popularized many of the features that make Python a great language. Python has excellent library support for a vast range of application areas. Knowing Python will help you pursue your future programming interests, wherever they may lead you.

E anche

Learning Cooperatively
With the obvious exception of exams, we encourage you to discuss all of the course activities with your friends and classmates as you are working on them. You will definitely learn more in this class if you work with others than if you do not. Ask questions, answer questions, and share ideas liberally.

Since you’re working collaboratively, keep your project partner and TA informed. Questa è scontata ma forse –OK, perso[nale], non leggete il mio commento.

Cooperation has a limit, however, and in 61A that limit is code. Homework problems should be completed and turned in individually. Feel free to discuss the problems with others beforehand; just submit your own work in the end. Parole sante! valgono anche per me quando affronto gli esercizi di SICP.

Copying all or part of another person’s work [… is a form] of cheating and will not be tolerated.

Rather than copying someone else’s work, ask for help. You are not alone […]!

Peccato non essere un giovane pischello californiano! 😦

OK, ma il manuale?
Non l’ho esaminato in dettaglio; non ho fatto gli esempi proposti (anche perché mi sembrano chiari e non sono difficili, almeno all’inizio).
Per non auto-spoilerarmi (ahemmm… a volte seguo la moda della post-truth) non sono andato oltre al cap. 1. Nel PDF c’è qualche codice HTML che è rimasto invece di essere interpretato, ma sono pochissimi e facili da sgamare.
Segue abbastanza fedelmente l’originale in Scheme, in qualche punto è aggiornato; in qualche punto Python impone di scostarsi, comunque è fatto bene.

Forse per quanto detto nell’intro al corso (e da me riportato sopra) mancano gli esercizi che il SICP originale propone.

Mi sembra usabile per imparare sia la programmazione (un po’, mica tutto) sia Python (un po’, mica tutto). E gli esercizi mancanti andate a recuperarli di là e fateli. Io invece continuo per la vecchia via, sono vecchio e abitudinario.

Anche se c’è sempre il solito rischio.

:mrgreen:

Posta un commento o usa questo indirizzo per il trackback.

Lascia un commento

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.