Database Bindings for Scheme? 12
alexhmit01 asks: "One of my classes requires us to write a system that will deal with accessing huge amounts of random data. The catch? The project must be done in scheme. Storing the data in a Database would make indexing and searching the data MUCH easier than manually creating hash tables and other ugliness for which scheme is AMAZINGLY inefficient at. Does anyone know of ODBC, Postgres or MySQL bindings for Scheme (preferably MIT Scheme, but we could use a different Scheme if need be)?" While perusing around, I found this page which which contains some information about Scheme and Databases. Are there any other bindings for Scheme that will allow you to connect to various database backends?
PostgreSQL Interface (Score:2)
Re:Write it in Scheme, ya shmuck (Score:3)
Huge amounts of random data? (Score:2)
--
if you're supposed to use scheme.... (Score:3)
If you're supposed to write it in scheme, I would assume that if your prof wants you to write it in scheme, using a very large piece of code that somebody else wrote in different language wouldn't be acceptable.
Re:if you're supposed to use scheme.... (Score:1)
While you might not want to port those numerical apps yet, the expressiveness and interactivity of scheme allows you to churn out applications at an amazing rate.
I tend to use python for small sys-admin programs ("python - a better shell") and web toys, but for anything larger than a few pages, I find myself pining for scheme. I never do get around to installing it tho, so I end up using java and jpython. I'm going to look into kawa right now.
Thanks for the kick in the pants!
use bigloo, scheme48, or java (Score:2)
Instead, use bigloo, scheme48, or some other Scheme with a decent FFI. Then you can use the native Scheme calls.
An even-better alternative is to use SILK [norvig.com] or KAWA [gnu.org], which are scheme systems that can interface with Java, thus using JDBC.
There's a great paper called "Java reflects easily through Scheme" [brandeis.edu] which discusses SILK and extending Scheme to allow access to Java code.
Good luck -- but with Scheme, you won't need it. What a great language!
~wog
This may help ... (link to rep-sql) (Score:2)
The link to squile was broken when I tried it. Maybe google will turn up something.
Re:Write it in Scheme, ya shmuck (Score:1)
JML [ed.ac.uk]
J HS [ex.ac.uk]
Neither is an interpreter, but for sheer perversity, they're both worth a look.
Johan
Re:use bigloo, scheme48, or java (Score:1)
er, I mean "C API calls". In any case, the SILK->JDBC approach is better.
~wog
Write it in Scheme, ya shmuck (Score:3)
Scheme is not AMAZINGLY bad or inefficient at anything. In fact, it (and more generally, Lisp) is arguably the greatest computer language in the history of the world. It still scares me to realize that designers of almost every other language in the modern computing era have had Lisp staring them in the face for the past half-century yet somehow still manage to miss the boat when it comes to simple, powerful things that should be in every language. A few examples would include: first-class procedures; lambda/unnamed functions; "scalar"/typeless variables; simple, non-ambiguous prefix notation; automatic memory management
My advice to you is to write your own hash table. It will consist of lists, car, and cdr - in others words, the same simple, basic things you've used to make pretty much everything else in Scheme. It will look infinitely more elegant that a bunch of cruddy database bindings which may or may not function as advertised.
Oh, and don't forget: Scheme can be compiled. I find this fact is frequently overlooked by C(++) bigots who shit on Scheme for being slow. Bigloo will almost always be within a few percentage points of an equivalent C program. With that in mind I'd remind you that Scheme isn't AMAZINGLY slow at anything: your algorithms are. If your program isn't running up to snuff then well my friend, as buddies in tech support used to say: PEBUAK.
(Problem Exists Between User And Keyboard)
Re:Write it in Scheme, ya shmuck (Score:1)
If your program isn't running up to snuff then well my friend, as buddies in tech support used to say: PEBUAK.
(Problem Exists Between User And Keyboard)
What, might I ask, is there between the user and the keyboard? I think that's why the expression is usually "Problem Exists Between Keyboard And Chair".
This reminds me... (Score:2)
Well, most of the other students were experienced C programmers, and so they just wrote a bunch of LISP wrappers for the available api. They ended being less efficient, buggier, and more difficult to deal with, and the students didn't learn how to use lisp to do actual tasks.
Probably any scheme/database library you find will be poorly documented and buggy. Its not worth it--do yourself a favor and use the power of the native language to solve your problem. It may even give you ideas about how to design better databases in the future.