Re: [Python-ideas] SI scale factors in Python

On Fri, Aug 26, 2016 at 03:23:24PM -0700, Ken Kundert wrote:
In your first post, you said that there were no languages at all that supported units as a language feature, and suggested that Python should lead the way here: I find it a little shocking that no programming languages offer this feature yet Now you say you've been using these "languages" plural for forty years. Would you like to rephrase your claim? I am unable to reconcile the discrepency. (There are three languages that I know of that support units as a first class language feature, RPL, Frink and Fortress. None of them are 40 years old.) -- Steve

SPICE, written by Larry Nagel, introduced the concept in 1972. It is a circuit simulator, and the language involved was a netlist language: basically a list of components, the nodes there were connected to, and their values. It looked like this: R1 1 0 1K C1 1 0 1nF I1 1 0 1mA SPICE was an incredibly influential program used by virtually all circuit designers for decades. Interesting, it was very likely the first open source software project. It was developed at Berkeley as a free and open source project, well before those terms were in common use, and it was highly influential on the BSD UNIX developers, also at Berkeley, which in turn were influential on Stallman at MIT. Verilog, a hardware modeling language adopted the concept in a small scale (just for time) in the 1980's. Then in the early 90's Verilog-A was created, a version of Verilog designed to allow people to model analog circuits. It allowed use of SI scale factors for all real numbers. A few years later Verilog-AMS was released. It combined Verilog and Verilog-A. It also allows SI scale factors on all real numbers. I developed Verilog-A as well as Spectre, a replacement for SPICE, and so I am intimately familiar with language issues, the implementation issues, and the user issues of use of SI scale factors in particular, and computational programming in general. So SPICE was a netlist language, Verilog was a modeling language. I was not aware of any general purpose programming languages that offer supports for SI scale factors or units. RPL, Frink, and Fortress are new to me. I took a quick look at Frink and it does not look like a general purpose programming language either, more like a calculator language. That is, of course, what RPL is. Neither really look up to taking on a serious computational task. Fortress looks like a general purpose programming language, but little detail seems to remain about this language, and I found nothing on units or scale factors. -Ken On Sat, Aug 27, 2016 at 01:48:29PM +1000, Steven D'Aprano wrote:

On 27/08/2016 10:44, Ken Kundert wrote:
Both example (SPICE and Verilog) are electronic design languages. So their task is easy, they allow only electronic units. It is very likely that your experience in these languages can't be used to translate a general purpose language. I know that F# use unit of measure (see for example: https://fsharpforfunandprofit.com/posts/units-of-measure/ or http://stevenpemberton.net/blog/2015/03/11/FSharp-Units-Of-Measure/ ) this experience can hardly transpose to python has it is an heavily statically type checked language.

It really feels like the OP simply wants Python to become a language for circuit design, with no consideration of general pulse usability, not of other domains. Little in the proposal translates well outside his particular domain, and the differences between domains simply make the proposed additions opportunities for new errors. On Aug 27, 2016 7:52 AM, "Xavier Combelle" <xavier.combelle@gmail.com> wrote:

SPICE, written by Larry Nagel, introduced the concept in 1972. It is a circuit simulator, and the language involved was a netlist language: basically a list of components, the nodes there were connected to, and their values. It looked like this: R1 1 0 1K C1 1 0 1nF I1 1 0 1mA SPICE was an incredibly influential program used by virtually all circuit designers for decades. Interesting, it was very likely the first open source software project. It was developed at Berkeley as a free and open source project, well before those terms were in common use, and it was highly influential on the BSD UNIX developers, also at Berkeley, which in turn were influential on Stallman at MIT. Verilog, a hardware modeling language adopted the concept in a small scale (just for time) in the 1980's. Then in the early 90's Verilog-A was created, a version of Verilog designed to allow people to model analog circuits. It allowed use of SI scale factors for all real numbers. A few years later Verilog-AMS was released. It combined Verilog and Verilog-A. It also allows SI scale factors on all real numbers. I developed Verilog-A as well as Spectre, a replacement for SPICE, and so I am intimately familiar with language issues, the implementation issues, and the user issues of use of SI scale factors in particular, and computational programming in general. So SPICE was a netlist language, Verilog was a modeling language. I was not aware of any general purpose programming languages that offer supports for SI scale factors or units. RPL, Frink, and Fortress are new to me. I took a quick look at Frink and it does not look like a general purpose programming language either, more like a calculator language. That is, of course, what RPL is. Neither really look up to taking on a serious computational task. Fortress looks like a general purpose programming language, but little detail seems to remain about this language, and I found nothing on units or scale factors. -Ken On Sat, Aug 27, 2016 at 01:48:29PM +1000, Steven D'Aprano wrote:

On 27/08/2016 10:44, Ken Kundert wrote:
Both example (SPICE and Verilog) are electronic design languages. So their task is easy, they allow only electronic units. It is very likely that your experience in these languages can't be used to translate a general purpose language. I know that F# use unit of measure (see for example: https://fsharpforfunandprofit.com/posts/units-of-measure/ or http://stevenpemberton.net/blog/2015/03/11/FSharp-Units-Of-Measure/ ) this experience can hardly transpose to python has it is an heavily statically type checked language.

It really feels like the OP simply wants Python to become a language for circuit design, with no consideration of general pulse usability, not of other domains. Little in the proposal translates well outside his particular domain, and the differences between domains simply make the proposed additions opportunities for new errors. On Aug 27, 2016 7:52 AM, "Xavier Combelle" <xavier.combelle@gmail.com> wrote:
participants (4)
-
David Mertz
-
Ken Kundert
-
Steven D'Aprano
-
Xavier Combelle