Hacker News new | past | comments | ask | show | jobs | submit login
The Arduino IDE 2.0 beta (arduino.cc)
297 points by dgellow 7 months ago | hide | past | favorite | 120 comments

The improvements described look great to me. Some are advocating for PlatformIO, but I still reach for the Arduino IDE even though I usually prefer vim or CLI tools. It's convenient and tutorials frequently assume you'll use the IDE. The IDE is great for people that just want to dive in and see some results. Asking someone really new to programming to install a plugin in another tool or issue arcane commands in the terminal is probably asking too much. All of that can be discovered later.

One of the nice things about Arduino IDE 2.0 and PlatformIO is the ability to install the CLI backend independently of the IDE, so people can transition to a CLI and editor if they feel inclined to go that route (e.g. experienced users or once someone has learned enough to move on that development process).

Lots of people here recommending that they should have just built an VSCode plugin. That is the wrong take IMHO. Arduino is a platform, they need to be in control of their platform. If they'd just became a VSCode plugin, they'd be at the hands of Microsoft and quite vulnerable to radical changes in VSCode.

That critique comes mostly from advanced users and it certainly makes sense.

The Arduino IDE is meant to be accessible to people with close to no experience though, a newbie put in front of VSCode will fill overwhelmed for sure, that's why the Arduino IDE exists.

I'm certainly biased but the new Arduino IDE is certainly a huuuuge improvement from the old one in lots of ways, it already has some new features like an autocompletion that actually makes sense, debugging, and more will be coming.

For autocompletion to work we actually created a custom Language Server, it certainly has been no easy task and we're still making improvements to it. It still has some rough edges but it works finely already and you can't get that experience anywhere else for now, VSCode doesn't have it.

Oh, and it has a dark theme too.

I strongly suggest people give it a spin before dismissing it cause of Electron, Theia, yet another IDE, PlatformIO or whatever, we're continuously improving it.

I'm probably an advanced user, and use VSCode at work, but I'm glad this isn't tied to it.

VSCode is really good at lots of things, but it's also a dodgy mix of FOSS and non-free software and it's huge and complex. For something like Arduino it's great that they retain independence and control for their own tools. I'm sure you can still develop in VSCode with third-party plugins.

(To be honest though, I would have been happy enough if they built it in Emacs, even if similar objections apply.)

> also a dodgy mix of FOSS and non-free software

See the current drama of Microsoft quietly introducing non-Free components into the Python plugin. [0][1]

[0] https://marketplace.visualstudio.com/items?itemName=ms-pytho...

[1] https://old.reddit.com/r/freesoftware/comments/n9z831

Wow, I was just thinking about The "Remote" extension for ssh and dockers, as well as the extension store itself. [0]

I didn't even know about this python business.


> I'm sure you can still develop in VSCode with third-party plugins.

The Arduino IDE 2.0 uses the ArduinoCLI as backend and they comunicate through a gRPC API, most functionalities are implemented only in the latter. It's technically feasible to create a VSCode plugin. :)

> (To be honest though, I would have been happy enough if they built it in Emacs, even if similar objections apply.)

Never used Emacs but I think it should be doable to integrate the ArduinoCLI as a plugin, if you want to take a try at it I suggest you read the docs. The gRPC is still not 100% stable though, I made a big refactoring in the initialization steps recently that still needs to be merged.


I agree completely, though for a different reason. Having an IDE specialized to the task makes it easier to so the tasks it's specialized for. Having the Arduino specific options intermingled with all of the other, possibly irrelevant, menus, options, etc. makes it harder to find the stuff that is relevant. Developing for microcontrollers is a lot different, and involves a lot of different configuration than your desktop or web development does. Having all of that front an center, rather than relegated to submenus, makes it a lot easier to use.

LSP works in most editors with minimal additional support. Their move is just catering to the lowest common denominator.

Couldn’t you just wrap up PlatformIO into a VSCode plugin?

That's what someone did for CLion.

PlatformIO is the way to go, VS Code plugin if you are so inclined, or just the CLI tools to use with whatever tools you like.

I am using arduino to teach newbies no older than 16yo. PlatformIO/VSCode/CLI are a terrible idea in that case.

Absolutely this. I'm nowhere near 16 anymore but if my first encounter with Arduino involved setting up PlatformIO or even CLI tools I would've moved on very quickly to something else. The whole point of Arduino is to be as beginner (and lazy people) friendly as possible.

I’ve been mentoring an FRC team (highschool age) where vscode has been the development environment for 3 years now. In my experience it hasn’t been one of our pain points.

A tabbed text editor is approachable enough for anyone that uses the web, and then we don’t use many features beyond the file tree view and a few items in the Ctrl-shift-p menu. It helps that the students interested in programming are usually comfortable using windows to start with but we also take students that don’t know how to use anything but a mobile OS and teach them.

Maybe, some kids like diving into the meat of things. Might be good to show them one way, but also let them know that the other exists. I've found PIO much easier to use after just a few days of playing with.

Sure, that is easy to do after you have them hooked up. But dead-simple installation is the only thing I care about when each extra click turns off another 20% of the newbies (made-up percentage). Especially if you want to present it as "a tool that you can use improve your main hobbies/interests", as opposed to something they should master. Pushing even further on this, when I show a PhD bio-engineer how to use Arduino to automate their bio-reactor, I am certainly going to use the two-click-to-setup Arduino IDE, instead of PlatformIO. The extra features are detrimental when all you want is to show a tool exists and can make your life easier and more interesting with minimum extra effort.

Is this a good summary:

PlatformIO for generation of value.

ArduinoIDE for demonstration of value.

Oh, sort of like why learn to ride a bike when you can just get a car or a moped?

Exactly the opposite. Learn the simple tool (the bike / the single click Arduino IDE) before expecting kids to know how an engine works. This is the most basic obvious principle in pedagogy.

Sure, but many kids won't have the patience to play with PIO. The Arduino experience to make a LED blink is literally connect the device, copy paste the blinker code into the big text box, select the device and port in the tools menu, click upload, done. That can be done in a few minutes without any of the kids getting too bored.

Yep. When I got an Arduino I was a bit disheartened at first to find people only talking about the Arduino IDE for programming it. I found a few custom makefiles and was half way to installing my own avr toolchain when I found platformio. I don't find joy in manually installing toolchains any more so it was perfect. I was up and running in minutes.

Although they don't mention it (maybe they should) I used pipx [0] to install platformio. It's the best way to install a Python app.

[0] https://github.com/pipxproject/pipx

The new Arduino IDE is based on Eclipse Theia, which I think is a fork of VSCode. It won't be hard for someone who starts learning with the Arduino IDE to switch to VSCode later.


Never heard of this. Thank you.

I've been teaching in University environment and the disparity of computers and operating system versions made the Arduino IDE the way to go. It just works everywhere.

Plataformio in my opinion is good for people who are familiar already with Arduino and VScode type of editors.

Been teaching as well using an ESP32 based board and we used VSCode with Platformio. It worked really well.

PlatformIO is super hard to install.

I really don't get why developers spend so much time developing some really great piece of software and then just make the install a really horrible experience. The last mile of software development, the install processes, needs to be unremarkable and boring.

What do you mean by install?

Arduino's IDE is nice for some boards since you install the software and everything is ready to use, but that is only the case for some boards.

PlatformIO is mildly more difficult to install since it is a two step process: first the VSCode, then the extension. Both steps are easy enough to do and to some people it is preferable since they are already using VSCode.

The difference between Arduino's IDE and PlatformIO come down to installing board support and libraries. Arduino's IDE is probably better if you are using Arduino libraries on a board that it directly supports since the installation process will be nominally easier. If that isn't the case, PlatformIO will likely be significantly easier since it supports more board, frameworks, and libraries.

I only used the VScode extension and is great. Except that it modifies the whole interface so I have two IDE instances one for with platformio and one without. It even encouraged me to write test for my arduino projects

Its been a while but I think I just hit install on the extension in vscode. It was pretty easy.

PlatformIO is 3 feet from gold. I still use Arduino IDE, it's a few clicks to get up and running.

My data point: I tried PlatformIO for an ESP32 project recently, but ended up with command line esp-idf because the complexities of another layer on top of everything just didn't seem worth it for a hobby project.

I used PlatformIO once, when I was using it to run the Arduino Libraries on an MT3620 Azure Sphere board, so that I could try programming for Microsoft's IoT board series with a more familiar language. It was a bit strange and clearly unofficial, but it did work and I was able to package Arduino sketches into OTA images for the board with it, so I can't complain.

For AVR programming, I have used MPLabX and found it fairly easy to use and program with.

I do use their official programmer, even though it is expensive (it can program AVR & PIC families) to avoid compatibility or driver issues.

I have used PlatformIO in the past too, but nothing beats a custom made IDE designed for programming a core set of chips.

I like micropython with my esp8266

As someone who has spent a lot of time programming Arduino I welcome this new IDE. IMO the thing that has always held back Arduino was the programming interface and the lack of tooling to write correct code. This is super important since this is targeted at students who will shoot themselves in the foot when they forget a letter in a function and they have to wade through gcc error codes.

The arduino CLI is always very much welcome.

It's sad that this is all coming out in 2021, rather than 2014 when Arduino was on a fast adoption trajectory. I feel that the lack of good IDE/tooling really hurt the adoption rate.

We used the Arduino IDE a fair amount building the code for an interactive art piece we deployed at the 2019 burn.


I believe we had to use the official arduino IDE to compile because we were working with a Teensy to get extra power and processor.


When getting really detailed with gameplay and audio cues it was always easier to just make edits in the IDE to test again and again.

It was missing a lot of conveniences that would have made the project easier.

I work with Pycharm most of the time so the Arduino IDE was like the land before time.

I’m glad to see this, it is important for early skill building to have some semblance of modern dev tooling.

Nice to see that it's not just another VS Code spin off. They seem to be finding a nice middle ground between the very basic Arduino 1 IDE, and an over-complicated all-in IDE.

Plus, debugging, woo!

What? That’s exactly what this is. Theia is a fork of VSCode that Eclipse maintains (with a slightly differently structured backend, I think), and they’ve forked that and removed the bits you don’t need for working with Arduino. You can see it in the screenshot, it looks like VSCode with less buttons.

I stand corrected!

VSCode already works better for me. Has all the intellisense and folder management I need. And has my favorite color schemes and git integration.

I've ever only needed the clunky Arduino IDE to install libraries and board types.

you cannot have full intellisense on Arduino project because of how the pre-processing works and generates headers and forward declarations. IDE 2.0 contains a Language Server developed from scratch to handle this, and every platform supported by ClangD works. Even using the Arduino plugin for VS Code won't offer proper completion, hinting and jump-to-definition

The only bug I've had was I need to flash my arduino with a project to "warm the compiler up" w.r.t. libraries and hardware capabilities.

Actually it would be much better if they just invested in VSCode for that.

It's based off of Theia, so isn't it another VSCode spin off?

Clicking it: "Please don't use electron, please don't use electron..."

Guess what modern technology the Arduino IDE uses?

Now that I have fully read the article I think this misses out on due credit though. The arduino cli looks pretty cool and there's no necessity per se to use the IDE 2.0 nor does it seem like there will be in the future. I just wish we weren't so reliant on web technologies to power what should really be native apps and it seems like everything uses electron nowadays.

I tend to agree with this POV. However, even I have to admit that VS Code (which this IDE is based on) is pretty much the poster child of Electron done right. For many languages it's quite literally IDE level of functionality, for less resources than most IDEs I've worked with (especially looking at you, JetBrains), extensions included. Of course YMMV, but it's been working pretty well for me. Hell, I've already had Slack take more resources (depending on the project).

(Now waiting for people telling me their vim setup works fine for them)

> especially looking at you, JetBrains

JetBrains IDEs are an order of magnitude smarter than anything VSCode provides.

Depends on the language/plugin. They seem to prefer their own plugins instead of using LSP and tools given by the language ecosystem and they often end up with vastly incorrect error highlighting and autocomplete. At least this is what I saw in the Scala and Rust plugins (Scala finally got damn good but it took many years).

My completions/auto-imports/refactoring/debugging workflow is more or less identical in VS Code and PyCharm for JS/TS stuff. Python it's so-so. The golang plugin has pretty good integration for all that stuff too.

I pretty explicitly said that some languages are doing better than others. Of course a language specific IDE will probably do a better job than a generalist one in most cases.

JetBrains IDEs provide a huge amount of functionality that VSCode doesn’t, so it’s not really fair to compare them.

JetBrains also makes most Electron apps look downright parsimonious when it comes to resource usage. Hopping over to my work laptop, mine is consuming 3.21G of memory idle.

Let's compare industrial grade IDE with state of the art inspections and refactoring capabilities to music players and chat clients.

> For many languages

It's perfectly fair to compare them for some languages (mostly web). Let's also not pretend like people aren't comparing vim and ST with VSC all the time, while they're very different products.

Not when one tries to compare similar workflows in SublimeText vs VSCode.

Unfortunely most rather get the free beer VSCode, so here we stand.

Last I tried setting up LSP in ST, it kinda blew. Tons of manual, machine specific configs. No debugging, refactoring...

From my POV they are _not_ comparable.

Indeed, ST wipes the floor of VSCode regarding performance, not comparable indeed.

Unfortunely, free beer is where most plugins end up being.

It's kind of horrifying to open my /Applications folder and realise that it contains probably twenty web browsers, eighteen of which are disguised as stand-alone applications. Often very simple ones.

BalenaEtcher, a pretty front-end for a bunch of drive-copying terminal commands, is over 200 megabytes. A competent developer could probably recreate its functionality with 20 kilobytes of shell script. Yes, this script probably wouldn't be cross-platform, but I dare say that there's more than 20 kilobytes of platform-specific code in the current BalenaEtcher app already...

>Yes, this script probably wouldn't be cross-platform, but I dare say that there's more than 20 kilobytes of platform-specific code in the current BalenaEtcher app already.

I can do what BalenaEtcher needs to be done in a shell, but how many can/want to? When you say "probably wouldn't be cross-platform" you have already given a reason for this to exist. "20KB of platform-specific code", you clearly know what you're talking about. You should write cross-platform applications.

I don't understand the point of your snark. If you're trying to pointing out that writing cross-platform applications isn't trivial, you're agreeing with me.

For better or worse, it doesn't really need to be smaller.

Of course it does. It's really a giant waste of bandwidth for a program that is probably 50% 'dd if of bs'.

Sure, and your house might look a smidgen better if it were painted a slightly different shade of the same color. It's a lot of work for very little gain.

Bandwidth is cheap. Human time is not. There are better ways to spend development time than shaving 2 seconds off the download of a utility app.

And yet loads of people still use it, and loads of people still recommend it... That’s what I mean by it doesn’t need to be smaller. It’s already hugely popular at the size it is, even though it’s a waste of bandwidth.

I felt the opposite. Fist pump in the air when I read the part where they said it would be an electron application. Why? Because I knew what it meant... Rather than trying to roll their own editor and doing a second rate job of it, they were likely leveraging something that was Tried and true, modular, and easy to use out of the box such as the Monaco editor (the same editor built for VScode). And the end product would be much better for it.

"Modern", now with features from VB in 1996: autocomplete!

All joking aside, this is a rewrite on top of electron, not something I would consider modern either.

> not something I would consider modern either.

It's not "modern" insofar as the idea of using a local webpage as a GUI dates back to at least HTAs in Windows 98 (if not sooner in the IE4 shell update for Windows 95)

I got an arduino kit sitting on my shelf I've been meaning to try. Does anyone have a recommendation of a good set of tutorials for beginner projects with arduino?

Competent medium programmer, looking to add lights, motion, sensors to 3D prints eventually.

The hard part with Arduino is not finding a tutorial, the hard part is deciding what you want to do with it so that you can collect all the right parts and then start programming.

For me, I learnt a lot of ideas from the MIT e-vent arduino repository. I’d say it’s a nice mature arduino project that’s not too large to grok. Ex. Abstraction of sensors into classes that have a setup, read, shutdown methods. Keeping timing state within the sensors etc. It really changed the way I was coding against arduino

I recently started arduino programming as well. What is weird is it’s basically the opposite of most software best practices.

You need to use global variables, not use heap allocations, avoid stl library classes, avoid strings, etc. The constraints due to the minimal resources mean you need to throw out elegant and robust programming in order to perform well. So the code ends up looking super hacky.

Calling code like that super hacky seems a bit weird to me. That's basically all I'd like to say, but to expand a bit (and possibly I'm missing your point somehow), in my opinion, "best practices" in software aren't "best practices" just because, but for reasons that may or may not apply in a specific situation. If they don't apply, then best practice dictates that they are no longer best practices.

That said, I'm not sure what I'd consider to be hacky code in a constrained environment. Looking at https://www.reddit.com/r/learnprogramming/comments/3cd0x4/wh..., for example, many things people feel are hacky don't apply to Arduino programming mainly because there is hardly anything external to interface with.

In embedded and machine control robustness is in simplicity. It is ok to repeat your self.

PLCs until recently only had global variables and a great deal has been accomplished with them.

A lot of machine controls and embedded work is more waterfally and less agile. Figure out what it has to do, make it do that, then it is done and you hand the machine or plant over to the customer and you can’t change it.

Most Arduino code I've seen at the hackerspace I used to go to barely had anything defined as functions. Just setup and loop. There were people who coded for many years and did very cool stuff and they didn't know what a struct was.

In addition to all the tutorials on the arduino site, Adafruit has a lot of tutorials about using their specific parts. Even if you don't have their specific parts, their tutorials (and libraries) can be useful if you have similar parts or parts based on the same chips.

This looks great! I've always hated the original Arduino IDE with a passion, but was too lazy to try something different...

I left the Arduino IDE behind to use VSCode with PlatformIO and it's so much better I can't understand why people would want to use the IDE. It's fundamentally broken in so many ways.

> ...the debugger supports all the Arduino boards based on the SAMD and Mbed platforms (MKR family, Nano 33 IoT...

[Clicks on the first link] --> 404.


Looks great, especially with the Monaco-styled editor.

Seems like a much better use of resources would to be just make a vscode extension.

There's already PlatformIO for that. VSCode is not really open and has nasty tracking included. The source is available under MIT however if you strip the tracking out and build that code like VSCodium does you may no longer use the add-on repositories of VSCode and have to use open-vsx.org. And the standard extensions made by Microsoft like the C/C++ extension may not be published by open-vsx.org. Since PlatformIO integration with VSCode/VSCodium is dependent on this extension you can not run it without submitting to tracking. That sucks. See also https://github.com/microsoft/vscode-cpptools/issues/6518

Well they have the command line build tool. IMO: focusing on the CLI so people could integrate it better into more mature/complete environments would have been much better. The main reason people use the Arduino IDE is because it doesn't drag in the complexity of something like AVR studio (which interestingly enough is just a visual studio extension IIRC.)

Agreed, I would argue having a special editor one needs to use is a barrier to entry for beginners or even people like myself who don't want to switch over to a new editor.

tried this recently and found "beta" to be an extremely optimistic description of the state it's in

Yay, it's electron based!

Really? Oh no! They had such a nice UI.

Arduino IDE used to be written in Java, hope that is still the case, it looks pretty good.

> hope that is still the case

I don't know why you'd care what it's written in, but for the reasons that I'd care (resource usage mostly) Java and Javascript are languages I'd hope it's not

Java and Javascript are in no way related. Compared to an Electron app something written in Java is likely to be fast and RAM efficient. Java might have been slow in the 90s, but the world caught up and overtook it years ago.

Yet that Arduino v1 IDE is everything but fast

Because it's not written in Java, it is written using Eclipse platform.

..? Arduino 1 IDE is a fork of the Processing IDE which has nothing in common with eclipse afaik ?

IDE 1.x.x is all Java IDE 2.x.x is Theia/Electron (Typescript)

Java is nice because it's nearly trivial to get native look and feel.

I'm not quite going to downvote you for this, just share my observation that I have never, once, used a Java app which has what I would consider a "native look and feel" for macOS.

Better than Electron? Sure. But native? Not even close.

Perhaps it's different on other platforms; I wouldn't know.

Because the lazy devs haven't read books like this,


Or willng to shell out money to frameworks like this,


Well I'm not a desktop Java developer anymore (thank the Gods) so I'll just take your word for it.

On a practical level, is there some example of a Java app which I could download and try out for native look and feel? See if my custom menu items show up, if I can drag a document window bar icon onto another application, basic stuff like that?

IDEA and related products are written in java and look and feel native to some degree. CyberDuck is java. Most developers don't know its so so easy to just toggle the look and feel to be native. A lot of app designers decide non-native even when it's native code, see adobe products.

Is that sarcasm? Didn't seem very straightforward last time I checked.

Not sarcasm; ignoring the surrounding try catch block, it's one line of code.

Most people don't know about LAFs.

A travesty, really

Can you supply an example? I gave up on Java GUI over 20 years ago because it looked horrible.

You were probably Doing It Wrong. The default L&F is not good, but its one line of code to select the native L&F. I commented on another post with a few example above.

Look up modern JavaFX apps, easy to skin with css.

JavaFX's text rendering is busted on macOS since Mojave in 2018:


So I give it an 'F' for the "look" part of look-n-feel.

I don't consider JavaFX a viable option. No native look and feel means automatic disqualification.

The new version is an electron app. It's based on Eclipse Theia, which is based on VS Code. https://github.com/arduino/arduino-ide

I've always used the Arduino IDE for building only -- the single button is nice -- and actually written code with vim. I really don't want another electron app, or vscode. I know that 'arduino' and 'vim' are targeting very different demographics, but I do wish they'd offer a bone in the other direction...

In the readme, it says that "backend operations such as compilation and uploading are offloaded to an arduino-cli instance running in daemon mode." Maybe you could use that program to build, while still writing your code with vim.

You can totally do everything with arduino-cli. I even use it inside of Python/Shell scripts to run operations

> In 2019, we announced the alpha release of a new IDE built on top of arduino-cli and based on a modern software stack (Theia and Electron)

Not anymore.

Not true. The IDE is based on the -cli. Please read the last few paragraph.

I just hope ulisp is compatible.

Still true. Why do you say "not anymore"?

Read the article, it's in the first few paragraphs. Arduino switched its internals to use Go (with a new Arduino builder CLI tool) two years ago, then started building a new IDE experience with Theia and Electron (JS-based) last year. There's zero Java in the future of Arduino.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact