Tracking units is a thing that I rarely have a use for (as a non-engineer), but when I do, I’m totally mystified by how bad almost every language is at it. F# is the only actual programming language I found that even tries. It does a pretty decent job, but even it has some disappointing holes (e.g. not being able to understand g and kg as scaled versions of the same dimension).
I guess the overlap between physicists/engineers and type system/PLT people isn’t large enough.
When I was a physics student, I would have loved a spreadsheet that tracks units, and automatically does conversions as needed. There is another huge thing that this enables: Tracking uncertainties. It would be awesome if you could not just write "10", but "10 cm ± 1 cm". Then the spreadsheet could do error propagation! Even the simplest case of non-correlated errors would be useful. Also you could have functions like "weighted mean" that take the errors into account. We used to do these calculations manually with extra columns and a few macros, but it was always error prone.
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.
Julia has the Unitful package [1], which does a decent job. It's quite ergonomic, and Julia's design helps with making existing code/libraries play nicely with Unitful-encoded units/values.
I guess the overlap between physicists/engineers and type system/PLT people isn’t large enough.
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].
I've recently written a units library for Nim [0]. It's still WIP, but it's already proven extremely useful for me as a physicist.
Thanks 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]
The Elm programming language ecosystem has the great "elm-units" library, which prevents one from mixing illogical units, and it produces logical unit combinations:
Julia has beautiful support for adding units to your programs. The nice thing about it is that you can plug unitful numbers into any other package and do math on them.
When I see this sort of thing I always want to know something that is seldom made clear: what is actually implemented so far?.
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".
This 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.
We must be evil twins in opposite universes. I've always wanted to be able to code the equations the way they look on paper. I actually am quite annoyed that most languages won't let you use Greek characters as variables. To me, it just makes it easier to spot errors.
Same here, writing code seems to map better to what you would step through solving the equations by hand. You can see how the equation “works”. But it may be, that I just haven’t gotten my mind wrapped around the concept of programming with equations yet.
This is a competitor to MathCAD which is used for things like structural calculations. I've used it for traction drive calculations. Generally you're implementing equations that are defined in papers and it's really nice to be able to make them look roughly the same.
In 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.
This reminded me of http://engineerjs.com/, a hobby project we did with some friends many years ago. One can write a JS code extended with unit support, linear algebra, complex numbers, create plots, share scripts, create libraries with interactive documentation support (this one never went public), etc. Everything runs in the browser on the user side. The test version (test.engineerjs.com) even has google drive support and can read/write files on it (although Google changed something in the meantime, and it started complaining about not being a verified application). The idea was that everyone could create libraries that others can import use directly. It doesn't have this nice GUI though.
I've done a lot of napkin math in NaSC [0]. Unfortunately it was buggy and often crashed so I had to stop using it. I'd love for something like this that could also be checked into repo and used to "compile" into constants that can be used in code. For example: plan the resources required to run for `demand(requests)` and load that into code and run that to scale up/down replicas or something.
Plugging, my own site, https://calcula.tech. It's not meant to compete with something like Atlas but I like to think it's great for napkin math, even though it's still quite early in development.
Looks like fun. I like it. Right now my tool of choice for calculation is Jupyter/Python, and it would be interesting to try both alongside one another on a moderately difficult problem.
I think this kind of this is called a notebook, isn't it? Not an IDE, since it's not for development and doesn't seem to integrate anything. I can imagine it would make a nice plugin for an IDE, though, for people doing that kind of work.
This looks neat. Writing tip for the person speaking (or captioning): starting a sentence with "so" makes you come off like...something I don't have the word for, but it's bad. Don't do it. Condescending? Demeaning? It's like you don't think your audience is capable of following. I had to stop watching after four sentences in a row started that way.
Or we could not police people's language. "So" is a way to start sentences; like anything else, it can be overused. Just like "like", etc.
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.
It's common in the Northern California tech industry. People will prefix questions by saying "Question" or statements with "So". It's sort of phatic, like a header that prepares the listener for what's coming. No one would take offence at it there.
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?
This is really cool. Is the main use case for something like this over wolfram alpha the use of writing the equations directly? Are there any other features that this has hidden that I can't get on wolfram alpha?
Something I think would be cool for a tool like this is to export code in various languages. Work out your algorithm in more "mathy" tool, but then spit out plain C#/F#/Python/Javascript to implement it in an app. Definitely a niche need, but I've had times where I think this would save a ton of time. This could also be useful where you have engineers who need to work similar to what the video shows, but then coders who need to implement in business software etc.
All those things, except units, can be done in Matlab. You can just drop a file into your workspace and they'll parse it!
They also have fantastic code generation support, so your "data cleanup" is actually reproducible.
And Mathematica is really good at typing equations.
[+] [-] burke|4 years ago|reply
I guess the overlap between physicists/engineers and type system/PLT people isn’t large enough.
[+] [-] captainmuon|4 years ago|reply
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.
[+] [-] sidpatil|4 years ago|reply
[1] https://github.com/PainterQubits/Unitful.jl
[+] [-] papaf|4 years ago|reply
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...
[+] [-] heisenzombie|4 years ago|reply
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.
[+] [-] V1ndaar|4 years ago|reply
Thanks 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
[+] [-] jimmyhmiller|4 years ago|reply
[0] - https://frinklang.org/#HowFrinkIsDifferent
[+] [-] jcelerier|4 years ago|reply
Here is a good in-depth comparison of the existing libraries:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p193...
[+] [-] jamil7|4 years ago|reply
[+] [-] klemola|4 years ago|reply
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...
[+] [-] rurban|4 years ago|reply
[+] [-] halfdan|4 years ago|reply
http://painterqubits.github.io/Unitful.jl/stable/
[+] [-] discordance|4 years ago|reply
https://reference.wolfram.com/language/guide/Units.html
[+] [-] PascLeRasc|4 years ago|reply
[+] [-] neilv|4 years ago|reply
https://en.wikipedia.org/wiki/Curl_(programming_language)
[+] [-] sk5t|4 years ago|reply
https://github.com/typelevel/squants
[+] [-] benhurmarcel|4 years ago|reply
[+] [-] g_delgado14|4 years ago|reply
Is there something that I'm missing here?
[+] [-] the-dude|4 years ago|reply
[+] [-] gjm11|4 years ago|reply
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".
[+] [-] mvzvm|4 years ago|reply
This 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.
[+] [-] gmiller123456|4 years ago|reply
[+] [-] spfzero|4 years ago|reply
[+] [-] IshKebab|4 years ago|reply
In MathCAD you can annotate them with actual snippets from the papers too. Definitely beats coding for some specific applications.
[+] [-] Chris2048|4 years ago|reply
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.
[+] [-] xdever|4 years ago|reply
[+] [-] gravypod|4 years ago|reply
[0] - https://appcenter.elementary.io/com.github.parnold-x.nasc/
[+] [-] fish45|4 years ago|reply
[+] [-] elcritch|4 years ago|reply
I’m curious about this one. Though I’d prefer a plain text storage format but otherwise it’d need to be cross platform.
[+] [-] analog31|4 years ago|reply
[+] [-] ampdepolymerase|4 years ago|reply
[+] [-] navane|4 years ago|reply
[+] [-] danellis|4 years ago|reply
[+] [-] forgotpwd16|4 years ago|reply
[+] [-] fiddlerwoaroof|4 years ago|reply
[+] [-] caymanjim|4 years ago|reply
[+] [-] andrewzah|4 years ago|reply
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...
[+] [-] chrismorgan|4 years ago|reply
[+] [-] renewiltord|4 years ago|reply
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?
[+] [-] ZephyrBlu|4 years ago|reply
[+] [-] PostHeat|4 years ago|reply
[+] [-] benhurmarcel|4 years ago|reply
[+] [-] shireboy|4 years ago|reply
[+] [-] 1cvmask|4 years ago|reply
[+] [-] siproprio|4 years ago|reply
And Mathematica is really good at typing equations.
I'm interested in seeing how atlas works.
[+] [-] ibraheemdev|4 years ago|reply
Btw, the thumbnail on the homepage is a bit fuzzy, although the video itself is good quality.
[+] [-] unknown|4 years ago|reply
[deleted]
[+] [-] javajosh|4 years ago|reply
But seriously, it looks lovely.
[+] [-] woggy|4 years ago|reply
[+] [-] R0b0t1|4 years ago|reply