[Python-ideas] SI scale factors in Python
Xavier Combelle
xavier.combelle at gmail.com
Sat Aug 27 10:51:28 EDT 2016
On 27/08/2016 10:44, Ken Kundert 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
>
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.
More information about the Python-ideas
mailing list