Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will any OOP grammar be supported? #42

Open
mySingleLive opened this issue Dec 19, 2014 · 14 comments
Open

Will any OOP grammar be supported? #42

mySingleLive opened this issue Dec 19, 2014 · 14 comments

Comments

@mySingleLive
Copy link

There are already some functional syntax in the design of streem.
Will the "class", "method", "inheritance" or any other OOP elements be in this language?
I think "everything is an object" is good in ruby. Can I use the "Stream", "Pipleline" as an object in runtime?

@alexispurslane
Copy link

No. I do not think that OOP is conducive to stream oriented programming. I'm not agains OOP in principle, in fact, I like Ruby, but in this context, OOP would feel slightly tacked-on and unwieldy. Objects, Methods, and Properties aren't suited to helping you think in a way that is based on filtering, mapping, transforming, and other stream oriented operations. That is why a more prototypal&functional approach might be better in this case. Prototypal is sort of a light wait version of OOP, so you could still program streem that way, and functional is inherently suited to list/stream based programs. (Just look at Lisp and Haskell).

@mySingleLive
Copy link
Author

ok, you mean that streem also is an object-based language(of course, Flow-based), it may use a light object model such as prototype , but not use the class-base model like in Java.
But I think class is needful. Prototype is not more efficient than class in most cases.
Certainly, that is my individual opinion. I'm not against Prototype :P

@alexispurslane
Copy link

Maybe. But I think maybe that even Ruby's notion of classes might be a little unwieldy in this case. I was suggesting prototypal because I feel that it has all the advantages of classical, but with a little more of a lightweight, flexible feel to it. Also, classical OOP doesn't quite match up with the idea of a streem oriented language. Functional programming seems best, actually. But then again, OOP might be really cool in this case, with a few tweaks and new features! :D

@nickserv
Copy link
Contributor

Functional programming and OOP can play together nicely, you just have to be careful about state. From my experience with JavaScript, I feel like there's not much that you can do with classes that you can't do with prototypes. Also, when dealing with items in streams, the prototyping could come in handy.

@alexispurslane
Copy link

Yeah... But maybe less weird/buggy syntax than js's for prototypes would do streem good.

@nickserv
Copy link
Contributor

Agreed. While I actually like how JavaScript does OOP with prototypes, the whole .prototype stuff can be pretty confusing at first. Maybe some sort of prototype syntax similar to Class < SuperClass or Python's Class(SuperClass) could work for Streem.

@alexispurslane
Copy link

I like the Swift syntax for inheritance: Class: SuperClass. It looks less like your comparing classes or calling classes.

@dajoh
Copy link

dajoh commented Dec 22, 2014

F# does OOP quite well for a functional language.

@alexispurslane
Copy link

I like Haskell and OCaml's take on OOP. It's not quite OOP, but close enough to make OOP acolytes happy.

@nickserv
Copy link
Contributor

@dajoh Out of curiosity, do you have any examples you'd like to highlight? I haven't used F#.

@mySingleLive
Copy link
Author

Coffeescript replace the prototype with the “class” syntax.
It means that “class” is more practical. But prototype also can be used anywhere.

@alexispurslane
Copy link

I really don't think this should be closed. We haven't solved anything yet.

@mySingleLive mySingleLive reopened this Jan 2, 2015
@notduncansmith
Copy link

I like @mySingleLive's idea to follow in CoffeeScript's footsteps. class MyClass to create a prototype, and MyClass::myMethod to get a method from the prototype.

@alexispurslane
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants