Git Product home page Git Product logo

swift-thoughts's Introduction

Hi there 👋

My name is Dimi Racordon. I love coding stuff, talking about programming languages and playing Stracraft 2.

I am a researcher focusing my work on type-based approaches for memory safety. My main research interests include type systems (obviously), language design, compiler construction and virtual machine implementations. I am currently directing most of my efforts in a project called Hylo with the objective to explore the use of mutable value semantics to create a safe-by-default and fast-by-definition programming language for generic high-level systems programming.

swift-thoughts's People

Contributors

alban-linard avatar dependabot[bot] avatar kyouko-taiga avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

damdamo

swift-thoughts's Issues

Small error in tutorial chapter 3

In the "Inout Parameters" section a comment says:

Note that this example just serves to illustrate the definition of inout parameters. Swift already has a
built-in swapPokemon(_:_:) function which should always be preferred.

I have a strong intuition that Swift does not have a built-in "swapPokemon" function, though it would be fun.

Errors in the chapter 7

In the "Protocols and Generics" part, after the 3rd code block, "... the associated type Element had to be mapped onto its the parameter T." should be "... the associated type Element had to be mapped onto the parameter T."

In the same part, before the last code block, "For instance, the following function accept any pair of type conforming to Stack, as long as are containers for the same elements, ..." should be "For instance, the following function accepts any pair of types conforming to Stack, as long as they are containers for the same elements, ..."

Errors in the chapters 4 and 5

CHAPTER 4

In the "Stored and Computed" part, the setter function contains : Int(newValue * 0.00076). It likely should be rather : Int(newValue / 0.00076)

In the "Lazy Properties" part, (it's a detail) print(bulby.pokedexEntry) in the first code block should actually print "Bulbasaur, the Seed Pokemon." (the begining is missing in the comment).
In the same code block, is it normal that the braces of lazy var pokedexEntry = {...}() end with parentheses ? (This might not be an error, but I'm not sure why they're there.)

In the "Property Observers" part, there is a small typo in the comment (after the 1st code block) :

Note that property observers are not called during initialization, as otherwise an observer may unsafely try to access the property it observers before it is initialized.

It should be "observes".

In the "Type Properties" part, there is a typo in "There will be only one copy of that properties". It should be "property".
In the same part, the question after the 1st code block should be "Why is Pokemon.strongest, ..."

In the "Methods" part, the comment after the 1st code block has a typo : " Hence, we could have written only firends.contains(...) ..." it should be "friends.contains(...)".
In the same part, after the 6th code block, "Enumerations ..." (the s is missing).

CHAPTER 5

In the "Value Type Initializers" part, in the comment after the 3rd code block, there is a typo in "... Swift doesn’t provide you with neither default not memberwise initializer anymore.". I tshould be "neither ... nor ..."

In the "Class Initializers" part, after the 1st code block, "As structs ..." here would mean something like "En tant que structs ...". I think you mean "Like structs ..." or "In the same way as structs do ...". This is followed by a typo : "... they can defined ..." should be "... they can define ...".

In the same part, after the 4th code block, this sentence is a bit confusing : "They just prepare some stuff buffer the actual (or rather designated) initializer is called:", I think you mean "They just prepare some stuff for a buffer, the actual (or rather designated) initializer is called:" or "as a buffer" maybe ?

THE END (for chapters 4 and 5 anyway)
Sorry for the long read...

Errors in the chapter 6

In the "Subclassing" part, in the first code block, Trainer's init function calls super.init() with no parameter. Isn't that going to cause an error ?

In the "Polymorphism and Casting" part, after the 2nd code bock, there is "we can’t access the properties of GymTrainer" instead of "... properties of GymLeader"

In the same part, "A subclass may be casted as any of its base class, but a base class may not" can be a bit confusing. Something like "... , but not the opposite" could be clearer here.

Errors in the Swift tutorial (Chapter 1)

  1. In the "Optionals" section, the comment (below) is wrong since trainer1 is initialized:
    var trainer1: String? = "Ash"
    // trainer1: String? = nil

  2. In the "Arrays" section, it would be important to specify that ArraySlice is a different type from Array, and that a slice keeps the original indexes from the Array. Also the "append()" function and array addition are not mentioned. Finally only 1 way to create empty arrays is shown, it could be interesting to add the other methods.

  3. In the "Dictionaries" section, a dictionary is declared as a constant and then modified here:
    enum SpeciesType { case grass, fire, water }
    let speciesTypes = ["Bulbasaur": SpeciesType.grass, "Charmander": SpeciesType.fire]
    speciesTypes["Bulbasaur"] = .water
    and here:
    enum SpeciesType { case grass, fire, water }
    let speciesTypes = ["Bulbasaur": SpeciesType.grass, "Charmander": SpeciesType.fire]
    speciesTypes["Oddish"] = .grass
    speciesTypes["Charmander"] = nil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.