Are there any "fun" ways to learn about Languages, Grammars, Parsing and Compilers? [closed] - compiler-theory

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm preparing for an exam concerning languages, grammars, parsing and compilers. It's not really my cup of tea and most resources I find use the language of mathematics to define the different terms of the trade and explain the different concepts I need to know rather than stick with English or French, which I would very much prefer. Therefore, I'm having some trouble both with finding the motivation to continue studying and with simply understanding the theory.
So here is my question: Do any of you know where I could find a "fun" way of learning all this? Or at the very least, maybe a more "concrete" and less "mathematical" way of handling this subject.
I need to cover the following so anything on these subjects is welcome!
Parsing (LR, LL, ...)
Grammars (Context-free, deterministic, ...)
Syntax analysis Static flow analysis
Impact analysis concerning software maintenance and dependency to user interfaces
Dynamic analysis
Here are some resources which could be considered "fun" (with an emphasis on the quotation marks) ways to learn about a technical subject, just to get a sense of what I'm looking for.
Why's Poignant Guide to Ruby
Try MongoDB (type Help +
Enter)

If you want to learn a lot in a short time, go learn about meta compilers from Val Schorre's 1964 (yes, you read it right) Meta II paper on how to build self-compiling metacompilers. As a freebie, they can compile conventional lanuages, too! The paper is 10 pages, describes meta compilers (as a virtual machine beleive it or not), and contains two complete compilers.
There's a mind-blowing moment you eventually arrive at when you grok how the compiler can compile itself... I learned compilers this way back in the early 70s and it is the most memorable compiler lesson I ever had. This is fun.
There is an online tutorial here which implements all the ideas in JavaScript..
The author of the tutorial is Dr. James Neighbors, the guy who invented the term "domain analysis". He used the MetaII ideas for a spectacular domain-specific code generator named Draco. Draco was a key inspiration to compiler-like tools I've been building for the last 30 years.

How long do you have to prepare? The "best" way to learn compilers is to dig into them and the best way to do that is to use the best book on compilers EVER WRITTEN: The Dragon Book It's old, but awesome. It's not cheap but it is, quite possibly, the most concrete and least mathematical way to learn about the magical compiler.
It doesn't have any flashing lights and it won't be in an awesome font like the Ruby guide, but it's in the top 10 Books Every Programmer Should Read

Related

is SICP still recommended? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have some experience with python, I asked for a new language, and said that i am having a hard time implementing what I have learned. they suggested I learn SICP. Saying it uses a great language and teaches great programming fundamentals.
But I notice it was published in 1984. Do you guys recommend it, or have I been trolled? :p
Thanks.
Yes, SICP is still a great book! The second edition, which is available online, as of 1996. Although, if you just want to learn Scheme instead of fundamental computer science, you might be better off with Teach Yourself Scheme in Fixnum Days.
I strongly encourage you to check out the book How to Design Programs. It focuses on the fundamentals of programming, not on the specific language, but it also uses Scheme as its language. It's also available free online.
You can also check out the current release of the second edition, which is in preparation (or the less-stable but more up-to-date current draft).
Firstly, you're loooking at the first edition. The second edition is from 1996.
You should VERY MUCH tackle the book. I've gone through about half and my mind is blown. I can't begin to explain how amazing it is. Not only will you develop an appreciation for elegance in programming, but you'll see the line blurred between coding and computer science.
Don't approach this book like a programming book. Approach it as if you want to learn the fundamentals of computation and computer science using programming as a means of expression.
SICP is one of the best books I've read for learning how to write programs well. I never used scheme outside of the work I did in that book, but it's well worth your time.

Cool, visually-transmissible uses of Prolog [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I will be teaching only one lecture on basic Prolog to students with little to no experience in programming. I'd like them to see that programming and Prolog can be used in the real world, perhaps even to do cool things.
I have looked at this and this threads, but I cannot find anything that is visually appealing that I can show them when we wrap up the lecture.
Do you have any suggestions for cool applications that use Prolog? I'm especially looking for something that can be shown as a video or slideshow.
If what you want is to highlight the uses of prolog and use audio-visual media merely for presentation purposes, combining the following 2 links might do it:
Natural language processing with prolog in the IBM Watson system
IBM's Watson supercomputer destroys all humans in Jeopardy
Dynalearn is implemented in Prolog and has animations.
See:
http://personnel.univ-reunion.fr/fred/Enseignement/Prolog/index.html
under "La librairie clpfd", there are links to 3 finite domain constraint animations (N-Queens, Sudoku, Knight Tour) that are used in this class.
InFlow is written in Prolog. You may browse through the examples and / or contact the author for details. VisiRule might also help.
Disclaimer: I have not used either InFlow or VisiRule, but I do use WIN-Prolog which is the environment used for both programs.
+1 for Visirule. It is, as far as I can tell (and I've researched this topic quite a lot) a unique visual programming tool (I don't know of any other visual tool that is easily reduced to a turing-complete language). I have implemented a trouble-shooting website with it along with various other solutions. Highly recommended- version 5 coming out soon too.

Algorithms/problems to solve while learning a new language [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
At some point in our lives we're put in the situation to learn a new language (either by job requirements or just passion). Personally, I'm trying to learn Objective-C coming from a background of several years coding php. My problem is that I'm bored with your average starting programs (most of them coming from maths; eg: Fibonacci).
What are your first algorithms and programs you write when learning a new language?
I'm thinking we could make a list of interesting problems to be solved and that would make the learning curve at least more entertaining.
Later edit:
My question is about fun things (and also useful), but not like Code Kata or other very boring math stuff (I've done many of those already)
Later edit [ 2 ]:
I found this today and the problems there seem fun to do.
Try to develop something proper, a project of some kind; solving algorithmic problems really only teaches you to apply the algorithm, not really a lot about the language your using.
Deciding on a useful project then deciding on a language and then 'doing it' will cover many of the bases you need to learn a new language.
I like this series of articles by Larry O'Brien.
http://www.knowing.net/index.php/2006/06/16/15-exercises-to-know-a-programming-language-part-1/
http://www.knowing.net/index.php/2006/06/16/15-exercises-to-know-a-programming-language-part-2-data-structures/
http://www.knowing.net/index.php/2006/06/16/15-exercises-to-know-a-programming-language-part-3-libraries-frameworks-and-mashups/
Have a look at these:
How do you find interesting problems to solve?
https://stackoverflow.com/questions/6327/what-are-your-programming-exercises
Just as an idea: Look at the problems of the The Computer Language Benchmarks Game.
When you've done a snippet, you can compare your solutution to the provided one.
Whenever I pick up a new language, I try using it to solve the problems at SPOJ. They basically support every mainstream language out there (as well as a few esolangs like Intercal and Whitespace). The problems are mostly from various ACM and similar format contests around the world and so can be quite hard, and perhaps be too CS/math for everyone's tastes. The tutorial problems are quite doable in any language.
I would also recommend adding that language's tag to your SO interested tags list. Many SO questions involve small snippets of code, and trying to answer them and looking at the other answers can be very enlightening.
But as soon as I've got the basics right, the strategy I choose is to try my hand at a very small project. Usually this a simple game, GUI app or a tiny webapp. This is valuable since there are some things you cannot learn by only doing small isolated blobs of code.
Try to solve these challenges using your new language. What's it all about:
In software we do our practicing on
the job, and that’s why we make
mistakes on the job. We need to find
ways of splitting the practice from
the profession. We need practice
sessions...
I sometimes use the exercises from the first few chapters of Structure and Interpretation of Computer Programs.
You can also try to understand or improve existing open source projects as suggested in this so question. Even though the answers are cocoa biased it should be a good starting point.
This way you can dive in to the level of your choice (understand, debug, improve) and in direction of your interest (UI, specific library, etc, etc...).
EDIT: When I said starting point, I meant that you can browse repositories for objective-c code, for example sourceforge

Pointers to some good SVM Tutorial [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have been trying to grasp the basics of Support Vector Machines, and downloaded and read many online articles. But still am not able to grasp it.
I would like to know, if there are some
nice tutorial
sample code which can be used for understanding
or something, that you can think of, and that will enable me to learn SVM Basics easily.
PS: I somehow managed to learn PCA (Principal Component Analysis).
BTW, you guys would have guessed that I am working on Machine Learning.
The standard recommendation for a tutorial in SVMs is A Tutorial on Support Vector Machines for Pattern Recognition by Christopher Burges. Another good place to learn about SVMs is the Machine Learning Course at Stanford (SVMs are covered in lectures 6-8). Both these are quite theoretical and heavy on the maths.
As for source code; SVMLight, libsvm and TinySVM are all open-source, but the code is not very easy to follow. I haven't looked at each of them very closely, but the source for TinySVM is probably the is easiest to understand. There is also a pseudo-code implementation of the SMO algorithm in this paper.
This is a very good beginner's tutorial on SVM:
SVM explained
I always thought StompChicken's recommended tutorial was a bit confusing in the way that they jump right into talking about bounds and VC statistics and trying to find the optimal machine and such. It's good if you already understand the basics, though.
Lots of video lectures on SVM:
http://videolectures.net/Top/Computer_Science/Machine_Learning/Kernel_Methods/Support_Vector_Machines/
I found the one by Colin Campbell to be very useful.
A practical guide to SVM classification for libsvm
PyML Tutorial for PyML
I think 1 is practical for use, 3 is clear for understanding.
Assuming you know the basics (eg max margin classifiers, constructing a kernel), solve Problem Set 2 (handout #5) of that stanford machine learning course. There's answer keys & he holds your hand through the whole process. Use Lecture notes 3 & video #7-8 as references.
If you don't know the basics, watch earlier videos.
I would grab a copy of R, install the e1071 package which nicely wraps libsvm, and try to get good results on your favorite data sets.
If you just figured out PCA, it might be informative to look at data with many more predictors than cases (e.g., microarray gene expression profiles, time series, spectra from analytical chemistry, etc.) and compare linear regression on the PCA'd predictors with SVM on the raw predictors.
There are a lot of great references in the other answers, but I think there's value in playing around with the black box before you read what's inside.

What's the best way to learn more advanced Ruby OOP constructs? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
So I've become a reasonably proficient Rails developer, and I'm finding that my bottleneck is now my lack of understanding of more complex Ruby constructs. I'm trying to build some plugins, and looking at some complex ones out there, their OOP wizardry is Greek to me. (I never had much formal OOP training so that's part of the problem.)
I want to better understand:
Sending methods from one place to another (include, extend, etc...)
Metaprogramming & overriding methods (super)
Class inheritance, modules, etc
Serious Ruby tomes seem like too much. Is there a pragmatic way to learn this stuff that will extend my powers without overwhelming me in the inner workings of the language?
The best way is to use it and learn by looking at code from others.
I don't think that there's a better place to start than the official documentation page.
Sorry if I've disappointed you, but there's no easy way to learn all those constructs.
You can also take a loot at some books, for example, the Pickaxe:
http://whytheluckystiff.net/ruby/pickaxe/
Take a special look at the OOP and metaprogramming sections.
I've found the ruby quiz to be a terrific resource to sharpen your knowledge of ruby. You can buy the book version or just use the entries at the site. Different problems will lend themselves to using different parts of the language.
I found these screencasts by Dave Thomas to be great for that, besides, it has pragmatic in the title so you can't miss :D
This Peepcode plugin patterns pdf actually answered all my questions; what I was trying to do was write a plug-in so it was exactly the information I needed.
the best way to start is understanding how class hirarchies really work internally so you know what gets call when. in otherwords you need to understand metaclasses.
here are the two resources that helped me the most to understand the concept: why´s explenation and another one
you could also try these ruby plus screencasts. there are alot about other topics you seem to be intrested in
You can also try and learn the basics of another langauge (Java or C# for instance).
I think learning a new language can be a very efficient and fun way to familiarize yourself with different approaches to solving problem (in your case object-oriented programming concepts).
Once you know how to code, learning the basics of a new language is both relatively easy and extremely entertaining, so you tend to make progress extremely fast at the beginning
And when you're trying to grasp concepts that are new to you, it might be easier to understand them in a framework that's also new. That way you can focus on the concepts you're trying to learn, and not on the way you could solve this problem differently in your language, etc...

Resources