A mode with no type checking to compete with Python


(Amir Michail) #1

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also?


(Chris Lattner) #2

Hi Amir,

We’re not interested in fragmenting Swift into related-but-different dialects.

-Chris

···

On Dec 5, 2015, at 11:51 AM, Amir Michail via swift-evolution <swift-evolution@swift.org> wrote:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also?


(Adrian Kashivskyy) #3

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

···

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution


(Brent Royal-Gordon) #4

Doesn’t Apple want to teach young people programming as one of its goals? If so, having a mode without type safety would be ideal for that.

Frankly, I can’t even imagine what Swift would look or act like without its type system. Would overloading work? What would happen if you added a String and an Int? What if you called a method that didn’t exist? Is it really better for learning to half-run the code and then crash instead of pointing out the mistake up front? Couldn’t you simulate half-running anyway by replacing syntax errors with `fatalError(“compiler error goes here”)` and running the code?

···

--
Brent Royal-Gordon
Architechies


(Austin Zheng) #5

I disagree with the idea that a type system is too much of a hurdle for beginner programmers to overcome.

Austin

···

On Dec 5, 2015, at 4:01 PM, Kevin Lundberg via swift-evolution <swift-evolution@swift.org> wrote:

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Austin Zheng) #6

No, I don't. I think Python's biggest appeal to new programmers is the fact that it has such a great standard library, making it really easy to do whatever you want to do without figuring out how to find or add in external dependencies.

Anyways, mistyped Python code still breaks, it just breaks at runtime instead of compile time. In fact, I'd argue that this is even less beginner friendly, since you might write a function that works with some inputs and then inexplicably breaks with others.

Austin

···

On Dec 5, 2015, at 4:09 PM, Amir Michail <a.michail@me.com> wrote:

On Dec 5, 2015, at 7:05 PM, Austin Zheng via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

>
I disagree with the idea that a type system is too much of a hurdle for beginner programmers to overcome.

Don’t you think that Python currently provides a better introduction to programming due to its simplicity?

Austin

On Dec 5, 2015, at 4:01 PM, Kevin Lundberg via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

--r‡bžÚḟîẁ
‰íz{CŠÊhĠ+bḃx§–)Ŷ_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/ma


(Amir Michail) #7

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Doesn’t Apple want to teach young people programming as one of its goals? If so, having a mode without type safety would be ideal for that.

···

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy <adrian.kashivskyy@me.com> wrote:

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution


(Kevin Lundberg) #8

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

···

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Amir Michail) #9

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

Apple need not accept apps written in this mode for the App Store. But it would be great for educational purposes.

···

On Dec 5, 2015, at 7:01 PM, Kevin Lundberg <kevin@klundberg.com> wrote:

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution


(Amir Michail) #10

>
I disagree with the idea that a type system is too much of a hurdle for beginner programmers to overcome.

Don’t you think that Python currently provides a better introduction to programming due to its simplicity?

···

On Dec 5, 2015, at 7:05 PM, Austin Zheng via swift-evolution <swift-evolution@swift.org> wrote:

Austin

On Dec 5, 2015, at 4:01 PM, Kevin Lundberg via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

--r‡bžÚḟîẁ
‰íz{CŠÊhĠ+bḃx§–)Ŷ_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/ma


(Manav Gabhawala) #11

I disagree with the idea that a type system is too much of a hurdle for beginner programmers to overcome.

Don’t you think that Python currently provides a better introduction to programming due to its simplicity?
I disagree. The only reason people think Python is a simpler introduction language is because so far Swift has only been used to teach iOS and OS X programming never as a programming language in itself. And if you decide to introduce someone to programming and have them jump into iOS or OS X programming they have to learn a new way of thinking (programming) as well as all the underlying complexities of building an app like the view controller lifecycle, run loops, target action, MVC, etc. If swift were taught as a pure programming language I think it would serve as a far superior introduction to programming than Python, or any other programming language that currently exists for that matter.

Austin

···

On December 5, 2015 at 7:09:51 PM, Amir Michail via swift-evolution (swift-evolution@swift.org) wrote:
On Dec 5, 2015, at 7:05 PM, Austin Zheng via swift-evolution <swift-evolution@swift.org> wrote:

On Dec 5, 2015, at 4:01 PM, Kevin Lundberg via swift-evolution <swift-evolution@swift.org> wrote:

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--r‡bžÚḟîẁ
‰íz{CŠÊhĠ+bḃx§–)Ŷ_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/ma

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Jon Shier) #12

Swift’s biggest issue preventing it from being a good teaching or learning language is its still rather poor error messaging, especially when the compiler becomes confused about types. Aside from that, type inference serves to remove the immediate need to learn about types for the beginner.

Jon Shier

···

On Dec 5, 2015, at 7:13 PM, Austin Zheng via swift-evolution <swift-evolution@swift.org> wrote:

No, I don't. I think Python's biggest appeal to new programmers is the fact that it has such a great standard library, making it really easy to do whatever you want to do without figuring out how to find or add in external dependencies.

Anyways, mistyped Python code still breaks, it just breaks at runtime instead of compile time. In fact, I'd argue that this is even less beginner friendly, since you might write a function that works with some inputs and then inexplicably breaks with others.

Austin

On Dec 5, 2015, at 4:09 PM, Amir Michail <a.michail@me.com <mailto:a.michail@me.com>> wrote:

On Dec 5, 2015, at 7:05 PM, Austin Zheng via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

>
I disagree with the idea that a type system is too much of a hurdle for beginner programmers to overcome.

Don’t you think that Python currently provides a better introduction to programming due to its simplicity?

Austin

On Dec 5, 2015, at 4:01 PM, Kevin Lundberg via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

--r‡bžÚḟîẁ
‰íz{CŠÊhĠ+bḃx§–)Ŷ_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/ma

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution


(Paul Cantrell) #13

I think Python's biggest appeal to new programmers is the fact that it has such a great standard library

This is not the case, at least in my teaching experience.

One of the largest hurdles for new programmers, and the one that differentiates beginning languages more than any other, is compiler strictness. This includes both syntax and static type checking.

We easily forget how hard learning syntax is: to see every piece of punctuation as significant, to read code as a parse tree, to think inside the box of the language’s type system. Programmers in their first months easily spend 50% of the time getting their code to compile, usually more like 80%.

The problem with compile-time strictness of any kind is that the compiler won’t do _anything_ until _everything_ compiles. I’ve seen this drive beginners to burnout, even drive them away from CS altogether. (To help calibrate your thinking about just how much we’ve forgotten that we learned: eons and eons ago, when my department taught its intro courses in Pascal and C++, the main first-year hurdle was not dealing with unsafe pointers, but knowing where to put the semicolons. Semicolons!)

When you don’t understand what a failure looks like, it’s tremendously helpful to be able to actually run the code and see the failure happen. Having the language say “this can’t possibly work so I won’t run it” is not helpful to beginners; it’s just bottled frustration. Having the language say “it worked until I got here, at which point this happened” is infinitely more helpful.

The biggest hurdle to a beginning programmer is how _stupid_ programming makes one feel. We experience programmers are all used to this. Beginners are not. Their successes are rarer, the obstacles more daunting. Every stumble feels intensely personal. Anything that makes success more incremental and more self-discoverable helps.

• • •

You might think at this point that I’m arguing in favor of the “no types to compete with Python” mode, but I’d vote against it.

The ideal beginner language has a flexible, forgiving syntax that rewards guessing; the least compile-time type checking possible; and very clear error messages (both compiler and runtime). On all three counts, this sounds very far from Swift today. Better error messages would be good for all of us, but the other two just don’t sound like Swift.

Good beginner languages reward exploration by empirical experimentation. Good professional development languages reward clarity of intent. Those two things are often in tension, and Swift’s core aesthetic clearly lands on the side of the second.

Is making it a good language for new beginners truly a design goal of Swift? I don’t think it should be. It _does_ seem like an excellent design goal to keep the language as simple, approachable, and learnable as it can be within its aesthetic.

Cheers,

Paul

P.S. The Bret Victor article that describes the thinking behind playgrounds has some oustanding ideas on making languages more learnable: http://worrydream.com/#!/LearnableProgramming

–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
https://innig.net@inthehandshttp://siestaframework.com/

···

On Dec 5, 2015, at 6:13 PM, Austin Zheng via swift-evolution <swift-evolution@swift.org> wrote:

No, I don't. I think Python's biggest appeal to new programmers is the fact that it has such a great standard library, making it really easy to do whatever you want to do without figuring out how to find or add in external dependencies.

Anyways, mistyped Python code still breaks, it just breaks at runtime instead of compile time. In fact, I'd argue that this is even less beginner friendly, since you might write a function that works with some inputs and then inexplicably breaks with others.

Austin

On Dec 5, 2015, at 4:09 PM, Amir Michail <a.michail@me.com <mailto:a.michail@me.com>> wrote:

On Dec 5, 2015, at 7:05 PM, Austin Zheng via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

>
I disagree with the idea that a type system is too much of a hurdle for beginner programmers to overcome.

Don’t you think that Python currently provides a better introduction to programming due to its simplicity?

Austin

On Dec 5, 2015, at 4:01 PM, Kevin Lundberg via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

--r‡bžÚḟîẁ
‰íz{CŠÊhĠ+bḃx§–)Ŷ_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/ma

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Bee) #14

Apple want to teach young people programming, properly. There, I fix it for
you. :slight_smile:

···

On Sun, Dec 6, 2015 at 6:55 AM, Amir Michail via swift-evolution < swift-evolution@swift.org> wrote:

Doesn’t Apple want to teach young people programming as one of its goals?
If so, having a mode without type safety would be ideal for that.

--
-Bee-


(Thorsten Seitz) #15

+1

-Thorsten

···

Am 06.12.2015 um 01:13 schrieb Austin Zheng via swift-evolution <swift-evolution@swift.org>:

No, I don't. I think Python's biggest appeal to new programmers is the fact that it has such a great standard library, making it really easy to do whatever you want to do without figuring out how to find or add in external dependencies.

Anyways, mistyped Python code still breaks, it just breaks at runtime instead of compile time. In fact, I'd argue that this is even less beginner friendly, since you might write a function that works with some inputs and then inexplicably breaks with others.

Austin

On Dec 5, 2015, at 4:09 PM, Amir Michail <a.michail@me.com <mailto:a.michail@me.com>> wrote:

On Dec 5, 2015, at 7:05 PM, Austin Zheng via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

>
I disagree with the idea that a type system is too much of a hurdle for beginner programmers to overcome.

Don’t you think that Python currently provides a better introduction to programming due to its simplicity?

Austin

On Dec 5, 2015, at 4:01 PM, Kevin Lundberg via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

This is somewhat possible today on Apple platforms with AnyObject. You can call any objc-visible method on AnyObject and it will compile, and the return type will also be AnyObject (I don't recall if the return type is optional as well or not). This doesn't work with value types, but neither does id in objc.

Having a more complete lax typed mode similar to Python or php I think is of limited usefulness, would add too much complexity to the language, and yield too much uncertainty about any given piece of swift code.

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe such a mode can allow Swift to be used by beginners also? _____________________________________________ swift-evolution mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

--r‡bžÚḟîẁ
‰íz{CŠÊhĠ+bḃx§–)Ŷ_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/ma

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution


(Alex Lew) #16

Yes! As a high school CS teacher, agreed 100%. This is what makes Racket /
Scheme such a great introductory language: there is really only one type of
syntax mistake you can make, and it's having mismatched parens (something
that the IDE makes it easy for students to see). When students move on to
Java for AP, in come the errors. I've seen students give up on CS because
they can never compile their code -- in one case, for example, a student
was putting semicolons after every if statement, for loop, while loop, and
method definition, before the opening curly brace. (In my experience,
syntax presents a bigger hurdle than type errors.)

Swift is not, primarily, a teaching language *for beginners*. (It makes a
great teaching language for intermediate and advanced students, or students
who want to learn about fancy type systems.) Its type system is extremely
powerful but also beyond the scope of an introductory programming course.
That said, playgrounds *are* very cool and help alleviate some of the
frustration of writing a long program and having it not compile.

···

On Sun, Dec 6, 2015 at 1:42 PM, Paul Cantrell via swift-evolution < swift-evolution@swift.org> wrote:

I think Python's biggest appeal to new programmers is the fact that it has
such a great standard library

This is not the case, at least in my teaching experience.

One of the largest hurdles for new programmers, and the one that
differentiates beginning languages more than any other, is compiler
strictness. This includes both syntax and static type checking.

We easily forget how hard learning syntax is: to see every piece of
punctuation as significant, to read code as a parse tree, to think inside
the box of the language’s type system. Programmers in their first months
easily spend 50% of the time getting their code to compile, usually more
like 80%.

The problem with compile-time strictness of any kind is that the compiler
won’t do _anything_ until _everything_ compiles. I’ve seen this drive
beginners to burnout, even drive them away from CS altogether. (To help
calibrate your thinking about just how much we’ve forgotten that we
learned: eons and eons ago, when my department taught its intro courses in
Pascal and C++, the main first-year hurdle was not dealing with unsafe
pointers, but knowing where to put the semicolons. Semicolons!)

When you don’t understand what a failure looks like, it’s tremendously
helpful to be able to actually run the code and see the failure happen.
Having the language say “this can’t possibly work so I won’t run it” is not
helpful to beginners; it’s just bottled frustration. Having the language
say “it worked until I got here, at which point this happened” is
infinitely more helpful.

The biggest hurdle to a beginning programmer is how _stupid_ programming
makes one feel. We experience programmers are all used to this. Beginners
are not. Their successes are rarer, the obstacles more daunting. Every
stumble feels intensely personal. Anything that makes success more
incremental and more self-discoverable helps.

• • •

You might think at this point that I’m arguing in favor of the “no types
to compete with Python” mode, but I’d vote against it.

The ideal beginner language has a flexible, forgiving syntax that rewards
guessing; the least compile-time type checking possible; and very clear
error messages (both compiler and runtime). On all three counts, this
sounds very far from Swift today. Better error messages would be good for
all of us, but the other two just don’t sound like Swift.

Good beginner languages reward exploration by empirical experimentation.
Good professional development languages reward clarity of intent. Those two
things are often in tension, and Swift’s core aesthetic clearly lands on
the side of the second.

Is making it a good language for new beginners truly a design goal of
Swift? I don’t think it should be. It _does_ seem like an excellent design
goal to keep the language as simple, approachable, and learnable as it can
be within its aesthetic.

Cheers,

Paul

P.S. The Bret Victor article that describes the thinking behind
playgrounds has some oustanding ideas on making languages more learnable:
http://worrydream.com/#!/LearnableProgramming

–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
https://innig.net@inthehandshttp://siestaframework.com/

On Dec 5, 2015, at 6:13 PM, Austin Zheng via swift-evolution < > swift-evolution@swift.org> wrote:

No, I don't. I think Python's biggest appeal to new programmers is the
fact that it has such a great standard library, making it really easy to do
whatever you want to do without figuring out how to find or add in external
dependencies.

Anyways, mistyped Python code still breaks, it just breaks at runtime
instead of compile time. In fact, I'd argue that this is even less beginner
friendly, since you might write a function that works with some inputs and
then inexplicably breaks with others.

Austin

On Dec 5, 2015, at 4:09 PM, Amir Michail < a.michail@me.com> wrote:

On Dec 5, 2015, at 7:05 PM, Austin Zheng via swift-evolution < > swift-evolution@swift.org> wrote:

>
I disagree with the idea that a type system is too much of a hurdle for
beginner programmers to overcome.

Don’t you think that Python currently provides a better introduction to
programming due to its simplicity?

Austin

On Dec 5, 2015, at 4:01 PM, Kevin Lundberg via swift-evolution < > swift-evolution@swift.org> wrote:

This is somewhat possible today on Apple platforms with AnyObject. You can
call any objc-visible method on AnyObject and it will compile, and the
return type will also be AnyObject (I don't recall if the return type is
optional as well or not). This doesn't work with value types, but neither
does id in objc.

Having a more complete lax typed mode similar to Python or php I think is
of limited usefulness, would add too much complexity to the language, and
yield too much uncertainty about any given piece of swift code.

--
Kevin Lundberg

On Dec 5, 2015, at 6:50 PM, Adrian Kashivskyy via swift-evolution < > swift-evolution@swift.org> wrote:

I can't believe I'm seeing a proposal to remove type safety, one of the
fundamental features of Swift...

Regards,
Adrian Kashivskyy
iOS Developer at Netguru

Wiadomość napisana przez Amir Michail via swift-evolution <
swift-evolution@swift.org> w dniu 05.12.2015, o godz. 20:51:

Python is still easier than Swift for beginning programmers. But maybe
such a mode can allow Swift to be used by beginners also?
*____________________________________________*_ swift-evolution mailing
list swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--r‡bž Úḟîẁ
‰íz{CŠÊhĠ+bḃx§–)Ŷ_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/ma

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Untracked with Trackbuster <https://trackbuster.com/?sig>

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution