joseaverde/Malef

Status of the project

Opened this issue · 5 comments

Promising project. Which is its status? Do you still plan to work on it?

I tried to run the examples, but they raised an exception on my system.

~/src/github/joseaverde/Malef/examples$  bin/boxes_modes 

raised MALEF.EXCEPTIONS.INITIALIZATION_ERROR : Couldn't initialise subsystems!
[/home/mgr/src/github/joseaverde/Malef/examples/bin/../..//alire/build/lib-linux/libMalef.so.0]
0x7f43651ffd3f Malef.Systems.Initialize at malef-systems-initialize.separate.adb:78
0x7f4365202c3d Malef.Initialize at malef.adb:60
[bin/boxes_modes]
0x559648f71c7e Boxes_Modes at boxes_modes.adb:219
0x559648f74f25 Main at b__boxes_modes.adb:386
[/lib/x86_64-linux-gnu/libc.so.6]
0x7f4364829d8e
0x7f4364829e3e
[bin/boxes_modes]
0x559648f71653 _start at ???
0xfffffffffffffffe

If you are interested on fixing it, I can provide whatever information you need.

It's been a while since I last worked on this project. But I still remember that error. I should write a clearer README file.

If you compile it with:

alr build

On Linux, in the alire/build/lib-linux directory you will find two libraries: libMalef.so and libMalef_ansi.so. The idea was that you had a common API for building terminal based interfaces. And, depending on the operating system or where you were trying to run the application, you could choose a dynamic library that implements it.

For instance, in the ol' Windows console, ANSI escapes sequences didn't work. But on most terminals, nowadays, they do. So, I wrote a common API for Windows CMD and ANSI terminals. And then when you run the application, the one that best suits your needs is used.

The problem here is that it is unable to find the libMalef_ansi.so library. So you would have to run the program:

LD_LIBRARY_PATH=../alire/build/lib-linux ./bin/boxes_modes

To run the examples.

This project was my first big project and I learned a lot from it. Then I started college and I couldn't find more time for it. I've learnt a lot since then, and if I had written the library today it would have been different.

Thanks for your interest on this project. And taking your time to try and build. Some of my friends have told me to continue with this project. Now I feel like I should resume it.

May I ask your opinion on what would you like to see in an Ada-based library for building terminal user interfaces?

The problem here is that it is unable to find the libMalef_ansi.so library. So you would have to run the program:

LD_LIBRARY_PATH=../alire/build/lib-linux ./bin/boxes_modes

To run the examples.

Thanks, it works now!
imagen

Thanks for your interest on this project. And taking your time to try and build. Some of my friends have told me to continue with this project. Now I feel like I should resume it.

That would be good news. It would be a good addition to the bare Ada open-source ecosystem.

May I ask your opinion on what would you like to see in an Ada-based library for building terminal user interfaces?

After finding your project, I recalled this message in forum.ada-lang.io:
https://forum.ada-lang.io/t/ada-library-wishlist/14/10

I find Textualize a great idea. Is the intention of your project similar to it, or is it more reduced in scope?

My original idea was cross-compatibility. I wanted to write a Terminal User Interface that would work anywhere. Because I had a lot of problems with curses' binding on Windows. Now I only use Linux, but my original idea remains the same: It should work anywhere.

What I had done at that time was a simple cross-compatible toolkit. If my memory serves me right, it should work just right on a Windows CMD.

I had in mind some kind of Widget tree structure. As you can see there is the package Malef.SDK.Message_Boxes that implements simple dialogs using the toolkit. As there are no examples on that Widget on the repository. Here is a Screenshot of a little project I did a long time ago, where I used this:

example

There are several problems with the current implementation, such as using Characters instead of Wide_Characters or Wide_Wide_Characters. In order to do those pretty menus Textualize does, you need the weird Unicode glyphs.
Also, it isn't very optimised, for example, I could have used a discriminant for surfaces instead of allocating them dynamically.

The idea was expanding the scope of the project bit by bit.

I've just finished exploring the Textualize library. It seems it is similar to your typical GUI toolkit (Qt, Gtk, ...), but it uses the terminal instead of the window manager.

I have done several experiments with GUI toolkits as well. It took me some time to get a Widget type I was comfortable with. That's the hardest part, writing the types so anyone could be comfortable using them.
I have a private repo with a GUI toolkit, which is more recent. The idea was similar, a common interface, several backends (one of them could be Malef, for TUI). Everything written in Ada. I might as well make it public. Almost all the internals are finished. I wanted to get this one right up before publishing, because fixing the base later would be a nightmare. I hadn't published it before because I wanted the toolkit base to be as robust and as comfortable as possible.

The library is subdivided in several simple components. The main library is a common interface for the components, it doesn't have any dependencies. The components would implement the Drawing of the Widgets. I had three subsystems in mind:

  • Pyramid: GLFW + OpenGL + Cairo
  • Malef: for Terminal based interfaces. This is would be the most similar thing to Textualize.
  • Aracni: for web-based applications using AWS or maybe the WebAssembly backend for Ada.

Then, you could run your App anywhere: a server without desktop environment, on your browser or on your desktop.

The project is far from finished, but I could focus on getting the TUI right.

Is this what you meant with Textualize? Maybe the project scope is too big. I will highly appreciate any feedback.

Interesting. Yes, Textualize is a library to implement TUIs in a way as close as possible to GUIs. They also have something similar to your idea of deploying applications to the web.

Your project scope is big, indeed. So focusing on the TUI part so you have something usable there first, seems like a great idea. That would be already a useful contribution.

Thank you! I'll start with the TUI right away. I should have more free time this next term.