[Python-ideas] SI scale factors in Python

Ken Kundert python-ideas at shalmirane.com
Sat Aug 27 04:44:54 EDT 2016


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 Fri, Aug 26, 2016 at 03:23:24PM -0700, Ken Kundert wrote:
> 
> > Second, I concede that there is some chance that users may be lulled into 
> > a false sense of complacency and that some dimensional errors would get missed 
> > by these otherwise normally very diligent users. But I would point out that 
> > I have been intensively using and supporting languages that provide this feature 
> > for 40 years and have never seen it.
> 
> 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
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list