I guess the overlap between physicists/engineers and type system/PLT people isn’t large enough.
Also, why is there no CAD program that allows me to enter errors? When I try to model real objects, say a room, the lengths never add up 100% and I always have gaps once I'm around the room. It would be great to say all these measurements are ± 1 cm, this one is ± 5 cm, and these angles are 90° ± 1°. And then it would do least-squares, and give me a really accurate model, or tell me where I have to measure again.
C++ has supported units, as a library, since the early 90s. The Barton Nackman book had the initial implementation [1] and it was picked up years later by Scott Meyers [2].
[1] https://www.thriftbooks.com/w/scientific-and-engineering-c-a...
[2] https://stackoverflow.com/questions/28698558/c-dimensional-a...
https://pint.readthedocs.io/en/stable/
I'm sure it's not as good as a true type system could be, but it works pretty transparently due to Python's duck typing.
I’m literally in the middle of writing a rate limited continuously run service wrapper around some existing one shot task code and while I initially thought about just parsing the rate definition out myself because it’s pretty simple to just split on “/“ or “per”, but after thinking through the usage scenarios I just ended up using pint to convert anything it can understand as a frequency.
So anything of the form x / time unit or x per time unit, and converting it to the appropriate scale for use by the rest of my code. A whole bunch of string matching code replaced by a one line (two if I count the defensive unit type check to prevent false positive parsing problems) that looks as simple as this…
default_sleep_interval = (1/ureg(default_rate)).to(“seconds”).magnitudeThanks to Nim's strong type system and metaprogramming features, it allows for a fully compile time design, without any runtime overhead (in form of special unit objects or such things; everything is a `distinct float`).
In addition Nim's unicode support, the code even looks nice!
A more complex use case (I can link more if desired): [1]
[0]: https://github.com/SciNim/Unchained/
[1]: https://github.com/SciNim/Unchained/tree/master/examples
Here is a good in-depth comparison of the existing libraries:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p193...
https://package.elm-lang.org/packages/ianmackenzie/elm-units...
...which is used in other packages where unit type safety is important, such as elm-geometry:
https://package.elm-lang.org/packages/ianmackenzie/elm-geome...
So instead of float, we have (eg) float_meters, float_feet and so on.
Is there something that I'm missing here?
radius = 15 [mm]
area = pi*radius^3
force = 100 [N]
def will_i_blow_up(pressure [Pa]):
if(pressure > 1 [Gpa]):
return "Oh no it blew up"
will_i_blow_up( force/area )
should raise an error like "UnitsException, [N/mm^3] is not compatible with [Pa]". I could then look over my code and realize I should have written: area = pi*radius^2This is a little odd to me - I generally prefer to write my math in code if its going to be executed. I find my preferences to be pen and paper (or whiteboard)> latex, so perhaps I am not the target demographic here.
However, input method support in editors isn't as straightforward, which can become a limiting factor if you have to work on a Julia codebase that uses Unicode characters and your editor doesn't make it easy to insert those characters.
In particular, I see a lot of this done in machine learning python code. Lots of "z", not "zeta", etc. Pretty tough to understand as a non-researcher.
> I actually am quite annoyed that most languages won't
> let you use Greek characters as variables.
$ python3
>>> φ = 2
>>> σ = 3
>>> φ + σ
5In MathCAD you can annotate them with actual snippets from the papers too. Definitely beats coding for some specific applications.
You prefer to write code as code, which makes sense as it skips the translation part - but technical code is the implementation of the math so any given equation can represent multiple possible code-implementations.
From that perspective, it might make sense to separate the two, with good tooling. Since tooling generally isn't good, it's just as hassle.
There's a good podcast episode from John Mcwhorter on this "So" phenomenon. [0] TL;DL It has some interesting applications (including functioning as a discourse marker), and isn't going away anytime soon.
[0]: https://slate.com/human-interest/2018/10/john-mcwhorter-on-s...
Just to emphasise this the more clearly: I’m talking about facts of life here, not ideals.
So, it's interesting it goes that far back.
Update: the language log says it goes back before the 1850s. With an early peak around 1870.
However, I agree that it is out of place in a demonstration video since people are looking for the info in the first place and already know what's coming.
Would you mind sharing where you're from so I know which region I should be careful to not offend people by speaking like this?
The most popular numerical computing environment for engineering is MATLAB, which is proprietary.
Outside of software and data science, is there any industry where the software landscape is dominated by the OSS players?
Academic publishing, maybe. Many of them rely on LaTeX, especially the mathematics journals, but even this is changing if I understand correctly—more journals are accepting submissions in Microsoft Word format.
[0] - https://appcenter.elementary.io/com.github.parnold-x.nasc/
I’m curious about this one. Though I’d prefer a plain text storage format but otherwise it’d need to be cross platform.
For example, I would have very different implementations of, say, the A* algorithm in C++ vs Python, to the point that they would not translate into each other very well
The video begins "This is Atlas, a concept for a new engineering IDE". (To me, that strongly suggests that rather little is actually implemented yet, and that what we're about to see is a lot of canned demos, because otherwise it would be a new engineering IDE, not just a "concept" for one.) But then most of what follows, and pretty much everything on the webpage, says that Atlas does this or that, not "will do".
And the trouble with "concepts" is that unlike actual implementations they aren't much of a guide to what you're ever actually going to get. It's easy to think "X would be cool" and say "Atlas does X", but some Xs are much more realistically implementable than others, and how interesting Atlas actually is depends on which of those Xs are ever actually going to be implemented.
But reading the page and watching the video I have literally no idea where the project is on a scale from "we wrote down some things it would be cool to do and rigged up a demo that pretends to do them" to "everything here is already implemented, though there are a few gaps and bugs here and there".
And Mathematica is really good at typing equations.
I'm interested in seeing how atlas works.
Btw, the thumbnail on the homepage is a bit fuzzy, although the video itself is good quality.
But seriously, it looks lovely.
Even tho I am not a engineer as such, when I develop or wonder something I have to use Numi, and visualisations are always DIY. Really excited about the Atlas block exchange part, I want a library of common math/physics functions & values so I dont have to google.
Page title is "A better engineering tool". Hard to say exactly what it is.. a competitor to Mathematica maybe? But it's not an IDE in the way most software developers would understand an IDE