Giter Club home page Giter Club logo

Comments (15)

sharkdp avatar sharkdp commented on May 24, 2024 1

(and the thread on HN)

Which thread are you referring to?

https://news.ycombinator.com/item?id=36864624

But if you are interested, I can send you a pre-release

Sure, I will be happy to test/use it.

Some beta testing would be great! I have attached a pre-release to this post. In order to use it, you need to create ~/.config/numbat and then move the modules folder from the archive to that directory.

You can find some preliminary documentation (tutorial, examples, reference) here: https://numbat.dev/doc/

numbat.zip

What are the planned new features?

The major new feature is that users can define their own units. We also introduce the concept of physical dimensions and statically check all code before executing it. All the predefined units/constants/functions are now also written in the "Numbat" language itself. Numbat is also orders of magnitude faster than Insect. It has much better error messages. It fixes some open bugs in Insect. And a lot of other things :-)

from insect.

archisman-panigrahi avatar archisman-panigrahi commented on May 24, 2024 1

Great. Now I have realized how to add custom units.

It will be handy to have let c = speed_of_light as a part of default setup. Since numbat is not trying to be a general purpose programming language (and everyone uses c for speed of light), having a default value for the variable c will not harm the user experience, in my opinion.

from insect.

archisman-panigrahi avatar archisman-panigrahi commented on May 24, 2024 1

I propose all the following for more convenience in the default user experience.

let c = speed_of_light
let G = gravitational_constant
let h_bar = ℏ
let magnetic_constant = µ0
let electric_constant = ε0
let bohr_Magneton = µ_B
let fine_structure_constant = α
let avogadro_Constant = N_A
let boltzmann_Constant = k_B
let gas_Constant = R
let bohr_Radius = a0

from insect.

sharkdp avatar sharkdp commented on May 24, 2024 1

Thank you for the suggestions. I refrained from adding some short aliases since I didn't want to pollute the one-character namespace even further. But I also missed having c for speed_of_light already.

I implemented all of your suggestions (but long names always lowercase / snake case), pushed a new beta release and updated the documentation: https://numbat.dev/doc/list-constants.html

from insect.

sharkdp avatar sharkdp commented on May 24, 2024 1

Yes, thanks. I found that too. It's a limitation of our unit simplification right now. I fixed it for now with a manual -> meter conversion in the unit definition, so now you should have the desired result.

from insect.

sharkdp avatar sharkdp commented on May 24, 2024

Ha! I also saw that paper (and the thread on HN), and immediately added oersted/Oe to the rewrite of Insect, that we are currently working on:

image

So in the new version you can do this:

image

Unfortunately, the new version is not yet public. But if you are interested, I can send you a pre-release (Linux binary, command-line version). It's pretty much on the same level, feature wise, as Insect. But has quite a few advantages.

from insect.

archisman-panigrahi avatar archisman-panigrahi commented on May 24, 2024

Ha! I also saw that paper

:)

(and the thread on HN)

Which thread are you referring to?

But if you are interested, I can send you a pre-release

Sure, I will be happy to test/use it. What are the planned new features?
You can upload the binary right here. In case you don't want to do that, you can also send me an email (can be found on my GitHub profile page).

from insect.

archisman-panigrahi avatar archisman-panigrahi commented on May 24, 2024

I get the following error in Linux Mint 21.2

./numbat: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

I tried sudo apt install libssl-dev, but that did not help.

from insect.

sharkdp avatar sharkdp commented on May 24, 2024

@archisman-panigrahi Thank you for trying. I now built a new recent release without a libssl dependency. You can find the download link and instructions here: https://numbat.dev/

Looking forward to your feedback!

from insect.

archisman-panigrahi avatar archisman-panigrahi commented on May 24, 2024

Now it runs!
Should I submit bug reports for numbat right here? I just realized that it does not have magneticConstant and electricConstant. Maybe it supports greek symbols, but it is hard to write greek alphabets on a regular keyboard.

It would be great if numbat already contains all the constants of insect (it is fine if they are renamed, like planckConstant -> planck_constant)

from insect.

sharkdp avatar sharkdp commented on May 24, 2024

Now it runs!

Great — thank you for the feedback!

Should I submit bug reports for numbat right here?

I wanted to add you to the numbat repository, but GitHubs permission system for private repositories is not very granular... it's either all or nothing. So please feel free to report Numbat issues in this ticket. Or if they apply to Insect as well, feel free to open new tickets.

I just realized that it does not have magneticConstant and electricConstant.

It does, but not under those names. We should add those long names as well. In the meantime, you can also create a ~/.config/numbat/init.nbt file and add

let magnetic_constant = µ0
let electric_constant = ε0

Maybe it supports greek symbols, but it is hard to write greek alphabets on a regular keyboard.

Yes, you can use µ0/ε0 — but mu0/eps0 are also supported.

It would be great if numbat already contains all the constants of insect (it is fine if they are renamed, like planckConstant -> planck_constant)

I think it does. See https://numbat.dev/doc/list-constants.html for a list of all builtin constants. You can also type list in the REPL. And feel free to report it here if you think something is missing.

from insect.

archisman-panigrahi avatar archisman-panigrahi commented on May 24, 2024

but long names always lowercase / snake case)

I mixed up uppercase and lowercase. Thanks for making everything lowercase.

from insect.

archisman-panigrahi avatar archisman-panigrahi commented on May 24, 2024

One more thing I just found in the new version.

>>> bohr_radius

  bohr_radius

    = 5.29177e-11 F·J²/(C²·kg·m·Hz²)

It would be great if it reports 5.29177e-11 m instead.

from insect.

sharkdp avatar sharkdp commented on May 24, 2024

You can now try this online here: https://numbat.dev/?q=mu0+*+2500+Oe+-%3E+T

from insect.

archisman-panigrahi avatar archisman-panigrahi commented on May 24, 2024

Works. I verified that T/mu0 -> Oe works too.
I am closing the issue.

from insect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.