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

Typed #12

Open
DAddYE opened this issue Dec 12, 2014 · 16 comments
Open

Typed #12

DAddYE opened this issue Dec 12, 2014 · 16 comments

Comments

@DAddYE
Copy link

DAddYE commented Dec 12, 2014

I know, I know, but In my opinion to achieve very fast performances I would opt for a typed and compiled language.

Something in the swift vein can be used for scripting and as well full featured programs.

What do you think?

DD

@matz
Copy link
Owner

matz commented Dec 12, 2014

Let me think about it. But it will not be explicit. Maybe some kind of type inference has chance.

@alexispurslane
Copy link

How about soft-typing? Such as, if types are defined, check the types, but if there are no types on the variable, make it dynamically typed? That would be very cool. I do not know how hard that would be to implement, but it seems like a good idea to me.

@matz
Copy link
Owner

matz commented Dec 12, 2014

@ChristopherDumas Indeed.

@dennisdegreef
Copy link

That is what HHVM's approach on PHP is as well, to be backwards compatible, but still gain the advantages of strongly typed variables if you would want to.

@jamonholmgren
Copy link

I've read that optionally typed languages suffer from an "all-or-nothing" problem, where the types are generally only beneficial if you make sure to type everything.

Dart has an interesting article about optional types: https://www.dartlang.org/articles/why-dart-types/

@nickmccurdy
Copy link
Contributor

I think it depends on whether this is meant to be more of a scripting language or an applications language, but if it's more of the latter, I think that static typing with type inference (how Go, Rust, and Swift do it) is pretty awesome.

@DAddYE
Copy link
Author

DAddYE commented Dec 12, 2014

@nicolasmccurdy 100% agree. I hope the direction will be on the latter (applications languages) since ruby mostly cover the former.

@nickmccurdy
Copy link
Contributor

@matz What's your opinion on doing static typing with type inference? Also, how much will streem focus on performance?

@matz
Copy link
Owner

matz commented Dec 13, 2014

I consider Streem as a DSL to build a data-flow pipeline. In that sense, having static typing is not 100% mandatory. I admit the benefit of static typing, and I will keep it in mind. But it isn't my top priority.

@alexispurslane
Copy link

Static Typing, even with the very best type inference, comes with a certain amount of verbosity. I find that not very likable for a language like streem, which is a scripting language and/or DSL (as far as I can tell). Dynamic typing would be nice, but then again, that comes with some bugs as well, and some amount of ambiguity. I think (as I said before) that dart-style soft-typing would come with some major benefits. That said, @jamonholmgren, many things in programming are often seen as an all-or-nothing thing: FP vs. OOP vs Prototypal, Static vs. Dynamic types, Logic vs declarative vs imperative programming, and so on. Many of these can be mixed (see JavaScript), and many of these are not mutually exclusive. Often, styles in programming (types of formatting and size of indentation.) And many, many things in programming are decided by

        A. The problem, or
        B. Taste, or
        C. Trends

@luikore
Copy link

luikore commented Dec 15, 2014

Thinking in true dynamic typing is completely different from the static typing way. Type inference on forced static typing is just a syntax sugar and doesn't change how you think (you don't have to write it, but you still have to care about it). What's worse, to make type inference look good, you'll tend to add more implicitness, like implicit type conversions which makes it even harder to find documentation for some method, or, extend the inference to whole-program-analysis which makes compilation much much slower. Inference on dynamic/optional typing may help performance, but that's implementation issue after design.

Static typing is not the only way for good performance, providing easier ways for user to optimize will give better results than "we already optimized that for you".

@JiechengZhao
Copy link

What about the idea of static typed pipe and soft typed pipe. In static typed pipe everything shall be typed, and in soft typed pipe there is no type at all. Somehow, these two kinds of type of pipes can be chained together. Trying to mixing these two concepts in a higher scope, not only on variables.

@dajoh
Copy link

dajoh commented Dec 20, 2014

@ChristopherDumas: Static Typing, even with the very best type inference, comes with a certain amount of verbosity.

Does it really? A Hindley–Milner type system doesn't need any type annotations to infer the types of a program.

@alexispurslane
Copy link

Hmmm. That is true, @dajoh. I do sort of like that idea. Haskell's type system is perfectly unobtrusive when programming. Maybe that is the way to go!

@nickmccurdy
Copy link
Contributor

@dajoh Agreed, if you do type inference well it can eliminate almost all the verbosity. Variables won't be able to change types, but I personally feel that's not a very useful thing to do anyway, especially in a functional language.

@alexispurslane
Copy link

Agreed! I think it really should be typed, as long as we have good type inference. Like Haskell's. And if we accept my suggestion of using partial application in Streem, we could even use Haskell's function type syntax!

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

9 participants