These are chat archives for jdubray/sam

11th
Nov 2017
ford
@foxaal
Nov 11 2017 00:15
converting app to SAM model -- it's like an invisible hand guiding you to "do the right thing". Nice.
Paolo Furini
@pfurini
Nov 11 2017 10:31
@jdubray re our prev chitchat on go: https://twitter.com/todd_mcleod/status/929053085888143361
Jean-Jacques Dubray
@jdubray
Nov 11 2017 11:53
@foxaal thank you so much for your comment, yet, it often feels like that to me. The rules to factor your code are very easy to follow, and I generally feel that I write better code following them than if I didn't.

@pfurini let me investigate futher

Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multi core and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It’s a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.

Is that BS? It’s a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.
Victor Noël
@victornoel
Nov 11 2017 11:58
if there is type inference, that would be acceptable
I would say that about kotlin, xtend or even ocaml for example :)
Paolo Furini
@pfurini
Nov 11 2017 12:00
@jdubray @victornoel yes in some regard both go and kotlin are modern languages that try to combine the benefit of static typing, with an expressive and concise language
but they are also very different in their roots, and goals
go is very easy to start with, but feels like a "toy" for not-so-young-anymore gals like me.. but I must admit that it has a great potential, and an even more adoption rate in the industry
Jean-Jacques Dubray
@jdubray
Nov 11 2017 12:08
I don't see too much value here:
type Books struct {
   title string
   author string
   subject string
   book_id int
}
func main() {
   var Book1 Books    /* Declare Book1 of type Book */
   var Book2 Books    /* Declare Book2 of type Book */

   /* book 1 specification */
   Book1.title = "Go Programming"
   Book1.author = "Mahesh Kumar"
   Book1.subject = "Go Programming Tutorial"
   Book1.book_id = 6495407
Jean-Jacques Dubray
@jdubray
Nov 11 2017 12:15

If I wanted to created a typed language I would do something like this (looks a lot like a present method, sorry)

function Books ({title, author, subject, book_id}) {
       let book = {title, author, subject, book_id}
       book = computedValues(book) //any derived value
       book = validate(book)                     // required field, ranges, ...  safety conditions
       return book
}

It looks like Go is not an OOP per say, since the structures don't seem to be classes.

So far, except for get the most out of multi core and networked machines I don't see much I would like in the language.
Paolo Furini
@pfurini
Nov 11 2017 12:17
Nope, go is not considered an OOP lang in its complete definition
And it will never be per its intended goals and philosophy
Paolo Furini
@pfurini
Nov 11 2017 12:26
I always had mixed feelings with go, whereas kotlin is one of the better designed language I've ever dealt with.. yes, it has its shortcomings, primarily because of its 100% compatibility with Java/JVM, but they iterate the specs very quickly, and make it better at every release
they just released a complete wrapper over reactjs, and now it's possible to write a full stack application, even with isomorphism, in kotlin (JVM on the server, JS+react on the client)
Jean-Jacques Dubray
@jdubray
Nov 11 2017 14:13
too much going on! Not quite sure what is Google's strategy, sounds a bit organic to me.
ford
@foxaal
Nov 11 2017 20:02
Is one of the "canonical" reasons for nap() existence simply to reset "dirty" bits in the model?
Jean-Jacques Dubray
@jdubray
Nov 11 2017 21:51
@foxaal not quite, it's truly about "automatic actions", actions that need to be triggered as the application state reaches a particular set of property values (e.g. if the car has reached started state and the rain sensor detects rain, trigger the action to turn on the windshield whippers.
You may interested in this: https://beakerbrowser.com