What is file-based source code?
Asked Answered
P

1

6

In the book "Programming Ruby" it says that ruby has file-based source code.

Take a true object-oriented language, such as Smalltalk. Drop the unfamiliar syntax and move to more conventional, file-based source code. [...] You end up with Ruby.

http://docs.ruby-doc.com/docs/ProgrammingRuby/

What does it mean for a language to have file-based source code?

Precondition answered 8/4, 2017 at 23:33 Comment(1)
Famous Kent Beck quote: "I mean, source code in files; how quaint, how seventies!"Commissioner
I
13

It means that source code is based on files. In the Intentional Domain Workbench, for example, there is no source text; the source is a Semantic Tree and is stored in a database, not files. In Smalltalk, there is no source text either; Classes and Methods are objects like any other object and are stored in the Garbage-Collected Object Memory like any other object – the Object Memory is then serialized to disk (and read back) similar to how RAM is serialized to disk when your computer goes into hibernation, the program actually never ever stops running, instead you edit the live objects in the system while the system is running. (LISP is similar.)

In Ruby, whenever the program stops, everything is thrown away, and when the program starts, everything is built up again. The file is "dead", it does not consist of live objects. When you edit the program, you edit a "dead" file, not the live system. That's what "file-based source code" means.

Isaiasisak answered 8/4, 2017 at 23:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.