So basically, there are 4 dimensions:
- Static (expressions have types) vs. dynamic (values have types)
- Strong (values cannot be coerced to other types without a cast) vs. weak (the runtime performs a variety of coercions for convenience)
- Latent (no type declarations) vs. manifest (type declarations)
- Nominal (subtyping relations are declared explicitly) vs. structural (subtyping relations are inferred from the operations available on types)
And you can place most languages on one of these 4 axes, though several support multiple forms of typing:
- Ocaml: static, strong, latent, structural typing
- Haskell: static, strong, latent, structural typing, with nominal typing available via newtype and manifest typing through optional type declarations.
- Erlang: dynamic, strong, latent, structural typing
- Scheme: dynamic, strong, latent, structural typing, with nominal typing available in many object systems.
- Common Lisp: dynamic, strong, latent or manifest typing. Same note about structural vs. nominal typing as Scheme, but nominal subtyping is used more often in practice.
- Python & Ruby: dynamic, strong, latent, structural typing. Nominal subtyping is available via isinstance or Ruby equivalent, but good practice frowns upon it.
- PHP: dynamic, weak, latent, nominal or structural typing. Culture is much friendlier to nominal subtyping than Python or Ruby, but it’s not required.
- Java & C : mostly static, strong, manifest, nominal typing. The casts give you a form of weak-typing when necessary, and C templates are structurally typed.
- C: static, generally weak, manifest, nominal typing.
- Assembly: dynamic, weak, latent, structural typing.
Scraping the Web
Some of us have spent years scraping news sites. Others have spent them downloading government data. Others have spent them grabbing catalog records for books. And each time, in each community, we reinvent the same things over and over again: scripts for doing crawls and notifying us when things are wrong, parsers for converting the data to RDF and XML, visualizers for plotting it on graphs and charts.
It’s time to start sharing our knowledge and our tools. But more than that, it’s time for us to start building a bigger picture together. To write robust crawl harnesses that deal gracefully with errors and notify us when a regexp breaks. To start converting things into common formats and making links between data sets. To build visualizers that will plot numbers on graphs or points on maps, no matter what the source of the input.
We’ve all been helping to build a Web of data for years now. It’s time we acknowledge that and start doing it together.
Oh yes. theinfo.org.
has_one, has_many and belongs_to in ActiveRecord
The table with the foreign key in it belongs_to the table that that foreign key references.
The table with the referenced primary key in it has_one or has_many of the table with the foreign key in it.
I will not forget this again!
