?

6 views
Skip to first unread message

Christopher Morgan

unread,
Dec 10, 2012, 12:53:26 PM12/10/12
to byu-cs-330...@googlegroups.com
Jay,

What are the definitions of strong and safe in the context of type systems? What is important to know about them?  

I can't parse my notes on the subject and i feel like your definition is more concise than the one given in the book.

Thanks,

Christopher

Jay McCarthy

unread,
Dec 10, 2012, 1:09:29 PM12/10/12
to BYU CS 330 Fall 2012
Strong has no meaning.

Safe means that it will not actually perform erroneous operations. Erroneous means violating abstractions such as that numbers, booleans, and strings are distinct. C is unsafe because you can add numbers to strings. Java is not because you can't. Even JavaScript is not, because although it allows "100" + 1, it gives that a meaning that it is faithful to.

Jay


--
 
 



--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Christopher Morgan

unread,
Dec 10, 2012, 1:12:17 PM12/10/12
to byu-cs-330...@googlegroups.com
Thanks! 

Instead of strong i meant to ask about sound, sorry. Sound?

~Chris


--
 
 

Jay McCarthy

unread,
Dec 10, 2012, 1:15:16 PM12/10/12
to BYU CS 330 Fall 2012
Sound means the static type system accurately predicts the dynamic behavior of the system. If the type system says an expression is of type Bool, then it really will return a Bool, modulo running forever or throwing "acceptable" errors, such as Div by 0.

Christopher Morgan

unread,
Dec 10, 2012, 1:27:00 PM12/10/12
to byu-cs-330...@googlegroups.com
Thanks! I appreciate it.


--
 
 

Reply all
Reply to author
Forward
0 new messages