ato
is a domain specific language (DSL) for describing electronic circuit boards. Itâs heavily inspired by, and attempts to follow the syntax of Python đ for consistency and familiarity.
ato
are a module
and an interface
.
An Electrical
is a special built-in type of interface
that represents a single electrical interface.
A component
is a subclass of a module
that expects to represent a single physical component.
You can also define your own types, in a similar way to defining a class
in Python.
Like classes in most modern languages, you can subclass and inherit from blocks.
module
as a component
, but not the other way around. A component is expected to represent a specific component.module
or interface
is done by assigning to its attributes.
self.
Instead, any assignments you make within the scope of a block, are automatically assigned to the block.
Built-in attributes influence the behavior of the compiler with respect to the block.
Setting the package
attribute, for example, makes the compiler select only components with the specified package to use in that componentâs slot.
interface
can connect to any other interface of the same type using the ~
operator.
1.23Ω
(option+Z on macOS), 1.23ohm
, 4.56Kohm
, 7.89Mohm
or similar.
Any attribute of any block may have a unit attached, written (without a space) after any number.
Unsurprisingly, a capacitorâs capacitance needs to be a capacitance (for example, 23.4uF
); other limits are in volts, amperes, degrees, and so on.
Add units.
10kΩ
resistor, but it probably wonât exist - itâll likely be at least 10kΩ +/- 0.1%
(which you can write!).
Tolerances can be written in the forms of:
1V to 2V
3uF +/- 1uF
4Kohm +/- 1%
3V to 3.6V
perhaps for a supply rail3V +/- 10mV
maybe for a reference4.7uF +/- 20%
for a generic cap25lb +/- 200g
đ€Łassert
keyword to apply constraints on the values of attributes to one another.
Supported operators are currently <
, >
and within
(all are inclusive of the bounds).
->
operator will specialize a module from its existing instance to an instance of the type on the right-hand side.
.ato
files:
from "where.ato" import What, Why, Wow
Notes on that statement:
What
, Why
, and Wow
are capitalized because they are in the source file. It has to match preciselyâitâs a type, and types should be capitalized, though this isnât enforced, and you can import things other than types from other files.ato.yaml
is), or within the standard library (.ato/modules/
)
import XYZ from "abc.ato"
. This is a legacy syntax and will be removed in the future. Use the new syntax.It also doesnât support importing multiple things on the same line.