Pros and Cons of Schemes (43)

1 Name: #!/usr/bin/anonymous : 2009-03-23 12:39 ID:xCfhRJI2

I have recently gotten into a lot of Scheme programming but I am wondering which implementation I should use. Which implementations are considered the "major" ones and what are the various pros and cons of each? I'm running on an Ubuntu Linux box and right now I have PLT Scheme and Guile installed. Are there other implementations I should consider? Ultimately I would like to be able to create GUI applications, and any cross-platform support would be very nice. PLT Scheme seems to have a compiler, and if an implementation lets me create native binaries (for my Windows-using friends) then that's also a bonus.

2 Name: dmpk2k!hinhT6kz2E : 2009-03-23 22:03 ID:Heaven

I like Gambit.

Gambit's one of the fastest Scheme implementations and it plays well with C: it's portable, can embed C, and can compile to C. Any platform with an ANSI C compiler will run your code.

Gambit is stable, has an excellent debugger, and has lightweight threads. The threads have attracted some interest; see Termite.

There are a couple drawbacks:

The first is Gambit's mark-and-sweep GC; it has no generations, it's not incremental, and it's not parallel or concurrent. For the vast majority this isn't something to worry about yet.

The second is the big problem: a dearth of libraries. Library availability trumps almost everything else. PLT at least has some.

If you're planning to write a commercial game, Gambit is a good choice, even with the GC. If you're planning almost anything else, PLT is saner.

3 Name: #!/usr/bin/anonymous : 2009-03-24 02:51 ID:k2D4X/yL

>>2
If it can embed C, how can libraries possibly be a problem?

4 Name: #!/usr/bin/anonymous : 2009-03-24 12:49 ID:Heaven

>>2

Thanks, I'll check out Gambit.

5 Name: dmpk2k!hinhT6kz2E : 2009-03-24 20:54 ID:Heaven

>>3
Libraries written for language X are still easier to use in language X than libraries written for language Y. Especially if X is a high-level language and Y is low.

Writing wrappers is its own time sink and raises the barrier of entry for any programmer. Then there's things that don't exist in C -- e.g. web frameworks.

Of course, it beats nothing. Foreign fuction interfaces are a necessity, especially for niche languages.

6 Name: #!/usr/bin/anonymous : 2009-03-25 04:36 ID:3yA5Aiuy

>>5
I know offhand at least one web framework for C, and I'm sure some searching will turn up more very strange people. Not that it'd be a fully pleasant experience, but it certainly exists.

7 Name: dmpk2k!hinhT6kz2E : 2009-03-25 23:04 ID:Heaven

Rule 42 strikes again, huh? I stand corrected. :)

8 Name: #!/usr/bin/anonymous : 2009-03-27 01:14 ID:R8OPbMKg

>>6

Are you referring to klone? If not, check it out.

9 Name: #!/usr/bin/anonymous : 2009-03-27 03:55 ID:Heaven

>>8
<a href="http://libcgic.sourceforge.net/">libcgic</a>. I'd forgotten klone, and tbh it's probably the "saner" choice -- at least, if you can call making cgi apps with C "sane". ;)

10 Name: #!/usr/bin/anonymous : 2009-04-04 14:56 ID:YljbT8PF

>>9
My very first job was with a web app startup years ago that had written all the CGIs in C for "bitchin' fast speed". They didn't use any "framework", they just wrote C that printf()ed each page.

I quit around the time they realized that random segfaults was a high price to pay for a speed boost over perl that would be considered incremental at best, considering that the speed gains are dwarfed by the latency introduced using http over the internet.

11 Name: dmpk2k!hinhT6kz2E : 2009-04-04 16:51 ID:Heaven

Was this before FastCGI or mod_perl existed?

12 Name: #!/usr/bin/anonymous : 2009-04-04 21:16 ID:FpWDaNBx

PLT and Chicken are the only ones which have a substantial number of libraries. PLT moreso than Chicken.

13 Name: #!/usr/bin/anonymous : 2009-04-04 21:55 ID:Heaven

> random segfaults

obviously whoever wrote it didn't know c. at all.

14 Name: #!/usr/bin/anonymous : 2009-04-05 05:52 ID:m6dyYq9T

>>1
IMO, common lisp suits you more. It's more powerful than scheme, and more complete, if you like. There's a lot of libraries and other code available, and some excellent implementations such as sbcl. Combine this with a good editor such as emacs (and SLIME), which are both free and available for ubuntu linux, and you're all set to write lots of lisp code. For the record, I had used MIT-Scheme back when scheme was to my interest.

>>13
Is exaggerating. But it's not a feature of C to segfault. If the application segfaulted that means it had at least one bug. There's bugs that don't make the application segfault, so these could also reside in the application, though without a visible side. The damage the company will experience if someone finds about those bugs and decides to exploit them is uncomparable to the price of having to buy more expensive hardware to allow the code to work.

>>10
Did they have a reason to use C? Ie had they written the code in some other language and they found out that the bottleneck is the implementation of the language they used? Did they try other implementations prior to the decision of rewriting everything in C?

The reason they failed is because they were incompetent. As such, they did not execute the actions a good programmer would've taken in sequence. However, you did not tell them anything against this. There's two possibilities here, that you did this knowing that they're doing something wrong, or you did this unaware of what they're doing wrong. If you knew, then it's your fault. If you did not know, then you are the biggest asshole I've met yet, because you left them, as you say, when they were in most need for help.

But no; I must admit there's a third case that we did not consider here. That case says that you're completely incompetent unlikely your co-workers it seems. See, the evidence which suggests this is when you mention that the speed gain is small compared to the network latency. That might sound correct at first, but at a closer inspection you fail to realize the true reason one would've chosen to write something in C for cgi: optimal use of resources.

Because with C you get the power to control the system resources precisely the way you want to, which I imagine was the reason they wrote in C, to serve more customers, to make optimal use of the servers hardware. Indeed, if it's anything that a good programmer does is to do what he's been asked and more, in the sense that he writes code better than what he was paid for.

You're one of these: evil, or an asshole, or ignorant of programming. Tell us now, which of the three?

15 Name: dmpk2k!hinhT6kz2E : 2009-04-05 23:42 ID:Heaven

Cool down >>14. >>10 didn't eat your children.

Also, I wonder how much experience you've had out in industry if the only possibilities you can draw from >>10's short post is that he's "evil, or an asshole, or ignorant of programming".

16 Name: #!/usr/bin/anonymous : 2009-04-07 06:13 ID:Heaven

>>15
I wasn't writing >>14 in seriousness, I think overall it's an entertaining post, with some truth in it.

17 Name: dmpk2k!hinhT6kz2E : 2009-04-24 23:34 ID:Heaven

One of the stranger things I've come across recently; the Omega operator:

((lambda (x) (x x)) (lambda (x) (x x)))

It runs forever in Scheme due to TCO.

18 Name: #!/usr/bin/anonymous : 2009-04-27 17:36 ID:Heaven

>>17
It's not that strange IMHO, (and somewhat old)
If you look at it this way instead of lambda expressions it becomes simpler.

(define (f g) (g g))
(f f)

19 Name: #!/usr/bin/anonymous : 2009-06-10 16:44 ID:CYpF7xr/

cons in Scheme makes linked lists. Ohho.

20 Name: #!/usr/bin/anonymous : 2009-06-10 18:27 ID:Heaven

>>19
FYI it creates a cons cell not a list.

21 Name: #!/usr/bin/anonymous : 2009-06-11 15:36 ID:JtVa7mhi

ты хуй.

22 Name: #!/usr/bin/anonymous : 2009-06-11 23:24 ID:N8xpq412

>>20
FYI you are gay. Ohho.

23 Name: #!/usr/bin/anonymous : 2009-06-12 09:12 ID:Heaven

>>22
Hm? First you bump with >>19, saying something incorrect and of no importance (or indeed, relevance to this thread), then I correct you, and then you insult me.

If you don't like being corrected, you shouldn't do anything that requires skill, or at least stay away from forums. Other than that, the distinction that I made for the definition of cons is very important.

24 Name: #!/usr/bin/anonymous : 2009-06-13 23:35 ID:N8xpq412

>>23
Hmmm, it seems that you are without a doubt a raging homosexual. One in ten people they say. Certainly the odds are not against it.

25 Name: #!/usr/bin/anonymous : 2009-06-14 00:50 ID:Heaven

>>24

> Hmmm, it seems that you are without a doubt a raging homosexual.
How can it seem without doubt, and what does that mean?

> One in ten people they say. Certainly the odds are not against it.
Not any more (or any less) than they are for you (if *) or anyone else who(*) is a part of the demographic used in the statistics, no.

Regardless, I'm going to let you reconsider but I'll also let you know that I'd rather talk about _programming_ here, than anything else. Quite often the likes of you are dealt via the reporting system. Perhaps you should appreciate that I'm taking you seriously, shall I say, lest I be misunderstood, that this is not a threat, but shall we say, it points out my willingness to co-operate with you.

26 Name: dmpk2k!hinhT6kz2E : 2009-06-14 01:17 ID:Heaven

Please don't feed trolls.

27 Name: #!/usr/bin/anonymous : 2009-06-14 01:34 ID:Heaven

>>26
I agree that getting involved in discussions with trolls is most boring and repetitive, I believe that this individual is not a troll, but rather someone who was "insulted" by my correction. Before you scold me for my beliefs, wouldn't you agree that you believe as well as I do on the matter; because you believe he's a troll, and I believe he's not one.

You'll also note that all my replies insofar to this thread have been 'sage' posts, namely >>20,23,25 and the one you read now.

28 Name: #!/usr/bin/anonymous : 2009-06-14 04:00 ID:N8xpq412

>>25,27
Contrary to what most homosexuals believe, the phrase "it seems" does not have in it implicit connotations of doubt. And it does seem that for the particular demographic of you, yourself, and probably your boyfriend, the odds are 1 in 1. And certainly I appreciate your opinion of me as not being a troll.

29 Name: #!/usr/bin/anonymous : 2009-06-14 06:33 ID:Heaven

>>22-25,27-28
same person.

30 Name: #!/usr/bin/anonymous : 2009-06-15 18:41 ID:fHEDrNWC

>>29
Person who is usually slowest in the uptake in conversations.

31 Name: #!/usr/bin/anonymous : 2009-06-17 13:26 ID:Heaven

>>1-30
Conversation which has been derailed; not that there were tracks in the first place.

32 Name: #!/usr/bin/anonymous : 2009-07-01 18:19 ID:9D+8w4kS

Place full of retards.

33 Name: jc : 2009-07-02 01:51 ID:NTc4GQe6

gcj (gnu compile java) is a good option. It supports Swing and compiles natively on windows and Linux. While easy to program the binaries are (still) large. Most have Java these days - if that is the case, a JAR distribution is small. You can run them with gij (gnu intrepreit Java).

Ruby is great too .. you can same some coding there. not sure about the gui for this though. I prefer coding html and just using the browser. You'll have to be a Javascript guru in the long run to make this work right.

34 Name: Anonymous : 2009-07-12 07:54 ID:RVbxF40P

Getting back to the OP, there's a list of Scheme implementations at http://www.schemers.org/

Regarding Gambit, a fellow uses it to create iPhone apps: http://jlongster.com/blog/2009/06/17/write-apps-iphone-scheme/

35 Name: dmpk2k!hinhT6kz2E : 2009-07-13 19:03 ID:Heaven

Turns out I was a bit off about the GC in >>2. I took a look at the code and it turns out that it uses a compacting GC for movable objects. So it's not just mark&sweep.

It's probably not too hard to add generations to a compacting GC. OpenMCL and SML/NJ both have or had them, and their performance was pretty good.

36 Name: #!/usr/bin/anonymous : 2009-07-14 02:23 ID:Heaven

I wolud reply seriously but I'm drunk. Do you have anything for drunk programmingsers?

37 Name: #!/usr/bin/anonymous : 2009-07-14 20:02 ID:4zPWg5mE

>>36 Perhaps a long night's sleep and a fry-up?

38 Post deleted.

39 Name: #!/usr/bin/anonymous : 2009-09-02 15:37 ID:oYEpu0db

I wish more schemes had hooks into SDL. OpenGL is great, and PLT/Chicken/Gambit/etc. support easily, but for simple 2D graphics and audio SDL is perfect. The chicken egg for SDL is outdated, and I can't get ypsilon (which has an excellent FFI) to compile on my PPC mac.

If you're making 2D games, maybe CL + ASDF/FFI/whatever + SDL is the better choice.

40 Name: #!/usr/bin/anonymous : 2010-06-22 12:38 ID:llF6/CR4

Two of the biggest cons of scheme are the car and the cdr.

41 Name: #!/usr/bin/anonymous : 2010-06-24 06:22 ID:Heaven

>>40
Terrible!

42 Name: #!/usr/bin/anonymous : 2010-07-01 07:11 ID:Heaven

>>41
I disagree. I think >>40 was VIP quality.

43 Name: #!/usr/bin/anonymous : 2010-07-02 02:26 ID:Heaven

>>42
>>41 was memetic, and in agreement with >>40. Note the italicised exclamation point.

(Or as they say, there is no difference between a bad pun and a good one)

This thread has been closed. You cannot post in this thread any longer.