Is scheme the most powerful language?

is scheme the most powerful language?

Other urls found in this thread:

julialang.org/
youtube.com/watch?v=B9moDuSYzGo
buildyourownlisp.com/
t3x.org/s9book/
github.com/kanaka/mal
bugs.ruby-lang.org/issues/12004
haskell.cs.yale.edu/wp-content/uploads/2011/02/history.pdf
leetcode.com/problems/invert-binary-tree/
unix-ag.uni-kl.de/~guenther/guile-scripts-howto.html
twitter.com/NSFWRedditImage

It's a very nice comfy language, hopefully you won't promote it too much though, I don't want the normies, SJW and hippsters knowing it.

No. C exists.

...

Not an argument

...

It's Turing-complete, so it's exactly as powerful as any other Turing-complete language. Scheme's problem is that it's so small that every implementation end up adding its own stuff, so you end up writing code for that implementation instead of portable Scheme. That's perfect for a teaching language, but awful for a production language.

Common Lisp is much better in that regard; it still has that implementation problem, but on a lesser scale. On the other hand, Common Lisp is fucking ugly and at times makes no sense at all. For example, you define local variables using 'let' and 'let*' if you want later definitions to see previous ones. Since functions are in a separate namespace from variables you have to use 'flet' instead of 'let'. So guess what the 'let*' equivalent is? You'd think it's 'flet*', right? No, it's 'label' because fuck you.

Is scheme the best language for programming challenges?

You can do the same easily with Perl.
#!/usr/bin/perl -wlfor (1 .. scalar @ARGV) { print join ' ', @ARGV; unshift @ARGV, pop @ARGV;}

Forgot pic


Maybe portability isn't needed all the time. Anyway a lot of stuff eventually gets rewritten despite being coded in C or something else.

That's like changing the words of the Bible and passing them off as your own.

Well, look at the old Unix from Bell Labs, even System V stuff. All that's pretty much rewritten entirely now.
Maybe *BSD still has some code fragments from the 80's, but probably not much.
Then there's all the changes due to differences in architectures, environment, and constantly changing compilers. There's no stability to speak of, everything is constantly being rewritten. I'm not sure what the benefit is, but that's what's happening.
I don't know of any stable platform where you can still run the same unaltered code as decades ago, other than some trivial things.
TempleOS wants to be a stable platform, but otherwise I don't know anything similar. Even so, it's married to amd64 platform, and the hardware is constantly changing.
I don't really get anything from this, everything I needed could be done on Amiga 500 or 80386 PC. I upgrade only because other people force me to, in order to use some websites I need for administrative purposes. Otherwise, I have no use for any of it.

for solving SICP

Here is the shifter in C. I didn't even know you could do "the first n characters in a string" kind of formatting.
#include #include /* Prints a string to standard output, shifts it by one, prints it again and so * on until one full rotation. * * @param string NUL-terminated string to shift. */void shifter(char *string);int main(int argc, char *argv[]){ if (argc < 2) { puts("Usage: shifter args*\n"); return 1; } for (int i = 1; i < argc; ++i) { shifter(argv[i]); } return 0;}void shifter(char *string) { int length = strlen(string); for (int i = 0; i < length; ++i) { /* Last i characters, followed by first i characters. */ printf("%s", string + length - i); printf("%.*s\n", length - i, string); }}


That's system programming, but I would like to have at least reasonably portable user programs. No one is going to use Scheme to write an operating system. You also have to keep in mind that C wasn't very portable until C99 when they added number types of fixed precision. Before if you wanted a 16-bit number you had to rely on the fact that short was 16 bits on your system, but now you can simply use int16_t. We also now have hard limits as macros in the standard, so you can write portable bounds checking that will work on any system.

Is Racket the best Scheme for SICP?

Thing is, I don't have any use for portable bounds checking, or anything related. And 16-bit "short" is just fine for me. I'm not into writing code that's meant to run everywhere. Just some old platforms is all I care about.
And if modern compilers are going to drop backwards compatibility with C89, then I'll stop using them altogether and go with something like Tiny C, or other simliar thing that's good enough to make text mode games run on Unix. This way I don't have to keep changing my code constantly for OS, compiler, or environment changes. All that stuff is a total waste of time for me.
Also, I really don't have any attachment whatsoever to modern systems, and would rather play on old systems that gave you full control over the hardware, sort of like TempleOS does. Except the old hardware was much simpler, so better from my POV.

SICP uses MIT-SCEME, but I haven't found any difference in using racket or guile.

MIT-SCEME comes with edwin, the editor used in the MIT SCIP course.

But I have been fine with Dr Racket.

Scheme is stupid flexible, you can redefine any procedure, so even if racket has their own implimentation of what SICP wants you to write you can overwrite it.

Nah, the liberal art students won't go after Lisp, because it's too visually appalling.

You didn't solve most of the exercises, obviously.

Use sicp package in DrRacket

Why is it called a shifter, when it rotates?

I don't see it rotating. I see it printing seven differently shifted versions of the list.

Holy shit, kill yourself. You knew exactly what the question was about yet felt the need to drop amazing Wikipedia wisdom.

>differently shifted rotated versions

skinhead wigger pls

I've been keeping an eye on julialang.org/

Even without the math and statistical aspects it seems like a very powerful language in the making.

youtube.com/watch?v=B9moDuSYzGo

Why Dr. Racket? Can't I just use emacs?

actually fuck it
i'm making my own scheme, with blackjack and hookers.

buildyourownlisp.com/
Do it faggot.

Forgot the other links
t3x.org/s9book/
github.com/kanaka/mal

In fact, forget about the Scheme and the blackjack.

...

Wow, so you hate brackets? That's pretty anti-semitic for CURRENT_YEAR+1

But I love brackets!

I even enjoy braces too. Some of my best friends are braces. But those parenthesis.. omfg those parenthesis. They're fucking everywhere! Acting like they own the place. Something needs to be done I tell you.

But I'm not bracist, I swear.

So literally every bible translation?

You can just use emacs, I was just saying that I was using Dr. Racket.

But is right, I haven't completed the book, so I'm sure I'm close to getting something that wont work.

Wow, they are really doing their best to make me stop reading. Are you sure SICP isn't better?

SICP is 100% the better choice.

You're probably better off reading Scheme 9 from outer space if you actually want to impliment a real scheme in C.

This is too good.

Please don't be a christfag.

sodomites get out

you can do it easily because you're not actually solving the problem, you're just calling code that someone else has written

you can say that easily because you're not actually expressing the idea, you're just using words someone else has invented

i feel no desire to argue with sophists. tell yourself what you wish

I genuinely don't get your argument, though. Which problem is he getting around exactly? I don't use perl but those functions he's using look like they're simple enough to abstract away, even though they're convenient.

I've been reading up on different scheme variants to work through SICP with and haven't been able to choose.

Gambit looks nice, but looks like 5 people total probably use it. Inlining C/C++ seems really neat though.
Chicken looks nice, but the name is stupid as fuck.
Racket seems like it's just some variant of scheme that people push at newbs because of its dumb fuck IDE.
People say MIT scheme is outdated.

I'm working through SICP right now. I started using Edwin, but the current version is broken on Windows. It has problems loading source files for editing, which is a big problem if you want to work on something over multiple sessions. So far Dr. Racket seems good. There is a SICP package you can download, which I guess is supposed to be faithful to MIT Scheme.

Point being, what editor or Scheme implementation you chooses shouldn't be such a worry that it stops you from pursuing it. You can easily find examples of people on line working through the book using other languages Racket, Common Lips or Clojure. What made SICP famoud wasn't the particular Scheme implementation from that course.

All lisp dialects are dead-ends. It's been this way for 60 years. I'm convinced they still teach it to you just to fuck over the west.

Agreed. Just learn Javascript and Ruby stupid goy

Isn't Ruby an abandoned hipster fad by now?

Oy, don't learn two languages. Only know one language really well. That way we can hire two programmers for the same job and pay you each a 1/4 of the price! Sholom.

Npt so much anymore. At least, not since since the cancerous COC Coraline Ada was pushing was rejected, and the Mormon nip in charge opted for a (mostly) sane one.

bugs.ruby-lang.org/issues/12004

*shrug* Perl has list primitives just as Lisp. That's one of the reasons I like it.

Doesn't it automatically flatten them or something?

*shrug*
*teleports behind you*
psst, nothing personnel, kid
*tips fedora*
*laughs alone*
*takes your hand and kisses it*
xDDDDDDDD

Did they honestly say that? kek

The reason the hipsters touched it with their latte covered fingers shouldn't be held against the language.

Fair enough, though I would suggest Racket over the others because it has the largest community of active developers and comes with a rather decent standard library (which other schemes are lacking). You can run racket/raco from the command line (or use emacs to simulate the DrRacket IDE) as the IDE is used by lots of people but it's mainly an offline toolbox that has excellent debugging tools. Of all the Lisp/Scheme variants Racket seems to have the lasting approach as they enable you to have your own Domain Specific Language (DSL) for really specialized topics (not that it isn't possible in other variants/languages). Racket is nearly on par with the performance of Common Lisp which is pretty fucking decent. Racket as a language is moving faster these days and lots of positive changes are being made, plus they do screencasts on YouTube where they have people who are working on high-level concepts with Racket break down what's actually happening behind the scenes with the type system, compiler optimizations, etc.

The only other Scheme implementation I would even consider would be Larceny, which beats all the other shit you mentioned by a large margin (even beats the performance of Racket). Personally I'm interested enough in Racket to invest some time into it as a hobbyist language whether there were jobs in it or not, and it's far more capable as an extension language than Guile will ever be.

Yea hasn't been updated in a long time and only supports r4rs or something. Should be enough to get through SICP/SICM though use something more modern with better debugging/profiling tools. Racket is a good option :^]

You're safe, those faggots are too stupid anyway to grasp LISP-related languages.


A rotate is by definition a circular shift.

It was a shitty language and only became popular because of rails. Now that it's dead so is ruby.

there's also homebrew

Then why isn't it called circular shifter?

Is the regular shifter called "non_circular_shifter"?

It's a lot more popular than Lisp and Holla Forums still promotes that moldy crap.

Homebrew was created by an admitted retard though. I much prefer MacPorts.

...

Is that a trick question or is it some fizz-buzz shit that you'd do as a homework in a first semester class?

struct node { int datum; /* Just some data */ struct node *left; struct node *right;}void invert_binary_tree(struct node *tree) { if (!tree) { return; } struct node *temp = tree->left; tree->left = tree->right; tree->right = temp; invert_binary_tree(tree->left); invert_binary_tree(tree->right);}

You could add additional restrictions, like avoiding recursion, preserving some tree property, ignoring NULL nodes or maintaining some particular memory layout. But if you can't come up with the above for a trivial case you should never code anything in your life ever again.

Lisp is just a Holla Forums meme, nothing more.

Fizz-buzz shit to filter Rubyists who don't understand anything low level. Although, in that particular case he could have done it in any language.

it's also probably harder to flip a binary tree on a whiteboard when there's a team of google engineers staring at your every move and your potential next job depends on it, just saying

It's not mirroring a tree, it is reversing the pointers (And end up with multiple roots).

m8.

No, he did it correctly. Inverting the tree really means reversing the invariant.

Synth is just a convenient way of building packages from the /usr/ports tree. You have no argument against it. By tying into the pkg system, it's easier to quickly audit out of date ports and even use pre-compiled packages if you want them, in the cases where your configure options agree.

It doesn't matter what you think it means, it's very likely they asked him that.
Google interviews are actually trick questions, they expect you to ask tons of questions before putting a single line of code.
vs

...

Thank you.

Shouldn't the suckless people flock to this language?


Wew lad!

Yes. And Chez is the best Scheme.

That's an internal separate process you won't get feedback from though.

Whatever the case, Google found that he was "not a good fit" for their organization. He should have left it at that, but no. Being a typical "rockstar" Rubyista diva, he bitched to the internet about it being unfair. Most likely proving google's decision correct in the process.

inb4 xkcd comic

A shared Lisp dialect...? Preposterous! Are you saying that all these Lisps share something in.... common?

The problem with common lisp is that there was no industry-wide decision to create and use it, like there was with X and CDE and therefore, in spite of its name, it's not really common. Hell, GNU made a whole new dialect of scheme just for the guix package manager; it's insane how incapable everyone is of just agreeing on one lisp to use.

cl is contentious and a lot of experienced lispers rejected it for trying to pander to imperative programmers.

GNU made a new extension language and then used it in guix, guile is used in a lot of larger GNU projects.

The problem is lisp was never a beginners language and was always mired in math so the barrier was high, and then it has this ability to be stupidly flexible to the point where most experienced people find it just as easy to extend lisp to have what they want rather than conform to a library.

Some dude on his own replicated all of the features of haskell in lisp by his own in a year, you can trivially add OO or DO, it really doesn't matter.

It's usage amongst experienced programmers + extensibility + hackers mentality has made lisp has made it a hard ecosystem.

you're retarded

Funny enough, that's exactly what happened with ML derived languages and Haskell.
haskell.cs.yale.edu/wp-content/uploads/2011/02/history.pdf

OK, that's marginally more complicated, but it's still trivial.
struct node { int datum; /* Just some data */ struct node *left; struct node *right;}void invert_binary_node(struct node *node, struct node *parent) { if (!tree) { return; } struct node *left = node->left; struct node *right = node->right; node->left = parent; node->right = parent; invert_binary_node(left, node); invert_binary_node(right, node);}void invert_binary_tree(struct node *tree) { invert_binary_node(tree, NULL);}
This assumes that you want both the left and the right pointer to point to the same node. This is no longer a tree though, because now every node except for the roots has more than one parent.

* fuck, I meant of course
if (!node) {
instead of
if (!tree) {

Different user here. This is why I don't come here too often nowadays. Holy shit are the people here immature, illiterate and/or14-year-olds...

"you're retarded" is your whole post and to top it off it doesn't even have capitalization or a period. I guess Holla Forums Holla Forums is and will continue to be a landfill of poor java coding and dick measuring contests alongside kindergarten-tier arguments.

Be ashamed, be very very ashamed.

QWERTYUIOPASDFGHJKLZXCVBNM
./!@#$%^&*()_+|~

use them how you like

SCHEME is a garbage-collected baby language just like Java.

Agreed. Scheme is harmful. Use Rust instead.

Good but now you pretty much leaked memory, probably need to save the roots in a vector or something.
(You don't get hired)

Is this a troll book?

every fucking time

Right, I should have saved the roots somewhere, but it's not like I was really putting effort into some shit code on an imageboard.

Because things like that have never ever happened before. Like with USB, or Ethernet, or ASCii, or the X Windowing System.

okay smart ass write it in fucking binary

lisp is shit

Bullshit.

You can tell a lot about a tool by the character of its users. Hipsters are people who get paid for self-promotion instead of knowing how to work. Therefore, a hipster language creates the comforting illusion of proficiency regardless of your actual ability. It's safe to conclude there's no software written in Ruby that actually does what it's supposed to.

...

What is that 2001 pajeet shit learn to code
#!/usr/bin/env perluse v5.12;for (@ARGV) { say "@ARGV"; unshift @ARGV, pop @ARGV;}
#!/usr/bin/env perl6say ~@*ARGS.rotate(-$_) for ^@*ARGS

lmfao in what world does that make sense

How does this even make sense? Is this the Fibonacci sequence of data structures, aka the useless algorithm? It looks like this Google test was put in place only to see how likely potential employees are of following their higher ups' orders, no matter how nonsensical they are.

I think it's more about showing that you actually understand how data structures work to weed out those who just glue libraries together at the beginning of the interview, kind of like fizzbuzz. I can't imagine this being a major question. Or maybe they expect you to ask back questions like "How are the nodes laid out in memory?" to see that you can think more than two steps ahead.

Nope. Not interested. I specifically ensure to not use any constructs that can't run on any release of Perl 5.

Whoever the faggot who failed the test was, I think I understand him. The question is abstract, poorly worded and intentionally misleading, and the answer is absolutely retarded from every point of view imaginable. I'm not sure how does this demonstrate any mastery over anything data structures, since it looks like something you would see from a newbie fucking up writing one of the identifiers of his tree mirroring function.

Do we really know this was what Google intended when asking that question, though?

leetcode.com/problems/invert-binary-tree/
Max was probably just this retarded.

This is why you use more abstract, garbage collected languages for interviews instead of being a C tryhard.

Nothing is as powerful as your processors assembly. Can you schedule interrupts? No? Then it is not powerful.

You do realise the question was almost certainly something like this.

You do realise the first part of your question has little to do with the actual question, right? A binary tree is a binary tree, no matter what it contains. The real question is which operation to perform on it, or what do you want to do with that binary tree, in which case a small introduction may be necessary. The question is still as nonsensical, as nobody with half a brain would interpret inverting a tree as turning it a multiple-head multiple-path single-tail linked list with redundant information in each node, because it makes no sense, and much less if we are thinking about a real world application, like it would be the case if we are thinking about Google's search algorithms, so the question is doubly misleading.

We don't have anything to go by besides some out-of-context tweet, so we don't know how the question really got asked or what the interviewer actually wanted. I think that the illustration in the link from makes much more sense, it is also how I initially understood and solved the problem (>>658456), and that is something you should be able to solve as a basic homework in data structures class.

Enjoy maintenance programming on EOLed RHEL versions and hand-rolling workarounds to solved unicode problems for the next 40 years then.

And yet a world class coder couldn't figure out what inverting a binary tree meant. Because it's not something you need to know. Google was just asking trick questions to trip him up.

Stop being ironically passive-aggressive. Max Howell is a retard, and so is everyone in this thread who genuinely thought inverting a binary tree meant anything other than mirroring

how do i make and use a scheme program that can do
-------------------------
echo "hello world" | ____
------------------------
from the terminal and will print hello world to the terminal five times? i hate bash. i hate it so much. is there a way to use scheme like this, like a scripting language?

unix-ag.uni-kl.de/~guenther/guile-scripts-howto.html

arigatou