Readit News logoReadit News
dymk · 2 years ago
Perhaps one of the most mind-boggling parts of this project is it has a hand-rolled parser for the subset of C++ that it can emit. All implemented in a single header. Equal parts impressive and crazy.

https://github.com/tpecholt/imrad/blob/main/src/cpp_parser.h

syeare · 2 years ago
What does this comment mean? Since not particularly well-versed in programming, all I understood was that this project has something that can read data? What is impressive about a tool that can read C++?

Would appreciate if someone can explain, thanks!

dymk · 2 years ago
C++ is a notoriously difficult language to parse [1], so hand-rolling a parser (even for a subset of the language) is an impressive feat. It's also interesting that they decided to implement their own tokenizer and lexer instead of using something "off the shelf".

[1] - https://en.wikipedia.org/wiki/Most_vexing_parse

klaussilveira · 2 years ago
This is amazing. It might be my Visual Basic nostalgia kicking in, but this is the icing on the imgui cake for me.
29athrowaway · 2 years ago
To this date there's no RAD experience faster than Visual Basic 6.
_mlbt · 2 years ago
Lazarus is pretty close and it’s cross platform.

https://www.lazarus-ide.org/

It’s Pascal instead of BASIC, which may or may not be an improvement depending on your perspective.

scrlk · 2 years ago
Given that Python appears to be the new VB6/VBA (in terms of adoption by a non-SWE user base), IMO there's still a gap for a decent VB6-like RAD experience within the Python ecosystem.

Qt Designer exists, but PyQt/PySide licencing can cause headaches.

varispeed · 2 years ago
Microsoft WPF was great as well. I thought they killed it, but seems like the project is still active.
WillAdams · 2 years ago
Interface Builder and Project Center on NeXTstep were amazing --- see Steve Job's 5-minute word processor demo.

For a large-scale real world project example consider that the NeXT version of Wordperfect was done is 6 weeks or so --- granted it started w/ a working Unix version, but it felt fully native and nicely polished (and was much better than the Windows version).

pjmlp · 2 years ago
Delphi, C++ Builder, WinForms.
sedatk · 2 years ago
Delphi could run circles around VB6.
mmargerum · 2 years ago
Delphi is leagues better and still supported
nottorp · 2 years ago
... or a more full featured experience than Delphi.

VB fails (or used to, haven't worked with it in a looong time) when you want to do custom controls and integrate them in the UI builder. With Delphi that used to be piss easy, you could even write designer-only methods that helped with custom configuring your controls, while with VB you had to do it in something else iirc. Too bad Embarcadero only wants to sell to enterprises that are stuck on legacy applications.

And what's with all the Pascal hate? Missing your <> and {}? Nothing wrong with begin and end.

What I wonder is: if the Rust crowd is hell bent on rewriting everything, why don't they clone the VCL and the GUI designer?

reddit_clone · 2 years ago
How about Delphi 6 ?

I have some good memories.

dsp_person · 2 years ago
This would be cool built in a wasm html5 app to whip up a gui in the browser and copy paste the result into your editor.

> It generates and parses C++ code which can be directly used in your application.

Is the parsing part just to read it's own code it generates?

dymk · 2 years ago
The parser: https://github.com/tpecholt/imrad/blob/main/src/cpp_parser.h

> Is the parsing part just to read it's own code it generates?

It would seem so. Their hand-rolled parser handles only a subset of the language. E.g. it hard-codes recognition for stl containers, and presumably only the ones that it might emit in generated code.

There's no AST built, at least not at this level. It tokenizes and lexes, and seems to leave it up to the caller to understand how to pump the parsing "state machine".

AST building and codegen appears to be done in this >9000LOC file - https://github.com/tpecholt/imrad/blob/main/src/node.cpp

giancarlostoro · 2 years ago
I've thought about making a RAD IDE for another language, and I'm kind of stuck wondering on strategies for stuff like this, I'd much rather just store the GUI info in another format like XML and only parse source files for things like methods that shouldn't be overriden when someone moves something.

I really wish we'd go back to having a lot more RAD tools.

nottorp · 2 years ago
> This would be cool built in a wasm html5 app to whip up a gui in the browser and copy paste the result into your editor.

Forgot how to install and run native applications? :)

"ImRAD runs on Windows, Linux and MacOS."

dymk · 2 years ago
Opening up a webpage is easier than cloning a repo, compiling, and running a binary
ddtaylor · 2 years ago
"You guys do have phones, right?"
_aavaa_ · 2 years ago
> wasm html5 app

That would seem a little anathema to a imgui library aiming to be native on multiple platforms and to have minimum dependencies.

joshcryer · 2 years ago
ImGUI generally runs on GLFW and there is even a port to html5: https://github.com/jnmaloney/WebGui

ImRAD appears to be based on GLFW as well so one would only have to follow a tutorial: https://uncovergame.com/2015/01/21/porting-a-complete-c-game...

dymk · 2 years ago
A multi-platform, minimal dependency project such as this is a perfect fit for targeting wasm, which of course is "just" another platform (not sure what additional dependencies you think it would need?)
dsp_person · 2 years ago
it's easy nowadays to compile imgui apps to wasm/html5

examples:

https://web.imhex.werwolv.net

https://floooh.github.io/sokol-html5/imgui-sapp.html

joenot443 · 2 years ago
This is fantastic. I've spent the last couple years working on an ImGui C++ app, this would have saved me many hours.
BatFastard · 2 years ago
I am just starting with imGui, tell me how this will save me time please?
consteval · 2 years ago
You can see the interface while you're designing it. Meaning, instead of writing a bunch of code, compiling, running, deciding one widget needs to be moved a bit you can just see it and move it.

You also save time writing a ton of boilerplate.

lainga · 2 years ago
Shouldn't it be "for the Dear library" given that the dear-imgui creator has stated it's named "dear"? (IMGUI means immediate-mode GUI, and ocornut has said he was inspired by another IMGUI named "simgui" [] )

> I renamed it to "dear imgui" (about 15 months later) because "imgui" has been hogging up the whole acronym. I am sorry for the confusion caused even today.

[] https://github.com/ocornut/imgui/issues/7892

TillE · 2 years ago
Dear ImGui is the full official name, but it's still extremely common to refer to it simply as ImGui (that's what the namespace is called, etc). It's definitely not just "Dear".
exe34 · 2 years ago
I don't think there should be so many sudos in there. otherwise looks really cool!
tecleandor · 2 years ago
Is the C++ generated code usable from, for example, Python when using pyimgui bindings?
secondary_op · 2 years ago
Why is GUI builder for ImGui is not implemented in ImGui itself ?
flohofwoe · 2 years ago
What makes you think that it isn't? Looking at the code and screenshot it uses Dear ImGui for its UI.