> We argue that only experts should use scripting languages (scripts) for 
computer programming because beginners cannot understand how dangerous the 
flexibility of scripts can be. For example, the assignment of variables 
with the same name to different types is often a cause of misunderstandings 
and failures. To make this problem even worse, failures due to wrong types 
are not captured at runtime---certainly not at compilation time (there is 
no compilation time in scripts). In other words, the interpreter is too 
permissive.  The scientist, if aware (rarely the case with students), will 
investigate the numerical output and, after much work, will find the source 
of the error. Therefore, this situation is not ideal. To exemplify, the 
following is allowed in Python (or Julia---similar syntax):
>
>```
>a = 1.0
>a = "a" # OK in Python or Julia
>```

Since I wanted the best of both interactive data exploration and statically 
compiled Go, I made the Go interpreter https://github.com/gijit/gi

Your students could use it to learn Go interactively at the REPL. Type 
errors like the example above will be caught:

```

$ *gi -q*                                

gi> *a := 1.0*                                                              
                                

elapsed: '121.083µs'                                                        
                              

gi> *a = "a"*                                                               
                                

oops: 'problem detected during Go static type checking: 'where error? err = 
'1:5: cannot convert "a" (untyped string constant) to float64''' on input 
'a = "a"'

gi>

```

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to