Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>[Scheme is] untyped, which makes it ideal for web-based programming and rapid prototyping.

Erm... While Scheme can be useful for web and prototyping, it is typed. That's why R5RS requires functions like number->string and so on.



Some people use "type" exclusively to refer to compile-time entities. By this definition, languages that are commonly referred to as "dynamically-typed" are actually "untyped", because they have only one compile-time type, which is essentially the same as having no types.


That's confusing weak/strong with static/dynamic typing, though. (A common error.)

"What To Know Before Debating Type Systems" (http://www.pphsg.org/cdsmith/types.html) is a pretty good introduction to types.

Also, while I'm only partway through Benjamin Pierce's _Types and Programming Languages_, it's been quite good so far.


Actually, your link agrees with my explanation:

It points out in the "Static and Dynamic Types" section that what is meant by "type" in static type-systems and what is meant by "type" in dynamic type-systems are two very different concepts. From the perspective of someone interested in static "types", dynamically-typed languages don't have types at all.


Specifically, this is the definition used in Computer Science research. Unfortunately, the communication between that community and the larger community of programmers is so poor that it was several years after I finished my CS bachelor's degree before I figured out why some people insisted that languages like Python were "untyped".


It's rather semantic, but I would differentiate typed from untyped by type checking vs. type being an inherent property of a variable.

So you have something in Scheme like:

     (define foo 1)
     (define bar "1")
And that is typed, the former being a number, the latter a string. If you try to subsequently do:

     (+ foo bar)
the program will error out.

Contrast this with what I would consider an untyped language like Python or Perl, where the translation from string to number is done without any warnings showing up.


Python is as strongly typed as Scheme; 1+"1" will produce an exception in Python.


Thanks. Point stands on Perl. Also... BASIC, among others.


What exactly does "typed" mean? Clearly there's a difference (in every language I know of) between True and 3.5 (boolean vs. float). Unless the language treats all memory locations equally and doesn't know anything about a memory location other than its pattern of 0's and 1's, I would consider the language "typed."


What "typed" means depends on who you're talking to. There's the definition used in CS research papers, and the definition that programmers actually use.

Very few languages lack a strong notion of run-time type. C and friends are the only ones I can think of where you can treat a block of memory as more than one type without the compiler or runtime throwing a fit.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: