Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Micah W
    @micahwelf
    I'm not very confident in these results. First, as was mentioned, Debian decisions were made out of relevant sequence to this information collection. Second, the questions I remember answering and the raw data don't represent the true sentiment that people feel. People frequently don't elaborate on a survey, but the nature of their concerns would eventually come to something logical that could be graphed if they did. For instance, Why do people prefer the FSF version?
    Most of the time, I see others agree with my feelings on licensing. The FSF version allows use without stealing the right to license one's code how they wish. Also, having the FSF suite for other languages already installed and in use is a good reason to prefer it for Ada support as well. This is a concern that should have been addressed before or as part of the survey, since the results would have likely been far different. Thus the survey is biased and not very scientific (the scientific method would have isolated the test variables from known influencing factors).
    I have native compiled Gnat Studio before. It must be rough on you all, because it was not easy for me to make a stable end program. It reads worse for others, on Debian at least. What I don't exactly understand is how much work it takes to create the Community edition from the Pro edition as you keep the Pro edition up to date. Also, the main difference that I see between your Community edition and the FSF version is what low-level runtimes can be used. If you did nothing but recommend specific versions or subversions of FSF GCC that would likely compile well, great!, but the real concern unique to the Community Edition is the functionality as an IDE, which should be possible with FSF, though I have tried in the past unsuccessfully. If the Community edition came without the compiler, but a pluggable connection to one in the system, would that have worked? However it all works or doesn't, having a prebuild IDE avec the appropriate Python version in-built is hinted in the survey as being what most people truly prefer, leaving all concerns of the actual compiler aside.
    Simon Wright
    @simonjwright
    I have native compiled Gnat Studio before. It must be rough on you all, because it was not easy for me to make a stable end program. It reads worse for others, on Debian at least.
    I’ve been trying to build a Python 3 GNAT Studio for macOS, which I think is a step too far, since AdaCore haven’t themselves reached a stable set of versions. I got to the point of being able to start the program & getting a Python garbage collection error during startup; I thought I might be able to trigger gc collections at various stages to try and narrow down where it was occurring, but now I’m in version hell and have lost heart.
    Simon Wright
    @simonjwright
    One thing I have learnt: I will never ever try to extend Python.
    YungTse Technology
    @YungTseTech_twitter
    Wise words.
    Python is a horrible language to extend.
    Hermann Rolfes
    @kungfooman
    I ditch software projects for the sole reason of having Python components (v8, emscripten) :joy:
    matrixbot
    @matrixbot
    marcuse1w Does anyone have an idea how to get gnat or gnu-ada on Archlinux ARM64 ? I know it is available for other distros like debian, but it is not available for Archlinux ARM. How cold I get it there ?
    matrixbot
    @matrixbot
    thindil Probably you have to build it by yourself. Or you could use a Docker image with gnat for arm64.
    ohenley
    @ohenley
    Is it possible to expand a given Python installation with a new module backed by Ada code?
    ohenley
    @ohenley
    From what I understand, gnatcoll-python gives you the capability of expanding an embedded Python in your binary ... right?
    I came across https://github.com/raph-amiard/ada-python-interfacing that looks like what I want but are there other alternatives? Thx.
    ohenley
    @ohenley
    Raphael Amiard is using cffi and I guess I could use cython and what not.
    matrixbot
    @matrixbot
    thindil ohenley (Gitter): As far I remember (if I remember wrong, please correct me πŸ˜‰), gnatcoll is based on Python 2.x and currently is on the way to support 3.x Thus, it is better not use it due to potential security problems. Using cython may be a good idea. Other option: if speed isn't crucial, you can create an API and use named pipes or something similar for communication. In that situation you will be able to use any programming language, not just Python πŸ™‚
    ohenley
    @ohenley
    Thanks thindil for the brainstorm; named pipes might actually solve my problem without too much headache. On another note, I think gnatcoll bindings now support python3 -> https://github.com/AdaCore/gnatcoll-bindings/tree/master/python3. Yesterday it built and ran successfully on my machine.
    matrixbot
    @matrixbot
    thindil ohenley (Gitter): You are welcome, and thank you for testing gnatcoll and correcting me πŸ™‚ About pipes, here is a nice Ada Gem about it: https://www.adacore.com/gems/gem-54 Tested on myself and this works very nicely.
    Maxim Reznik
    @reznikmm
    I would suggest Spawn API instead of GNAT.OS_Lib. It's in alire already https://alire.ada.dev/crates/spawn.html
    there is a separate version with Glib event-loop integration
    ohenley
    @ohenley
    @reznikmm It is the second time I come across that spawn API and as I have to deal with long-running child processes it looks like a good fit. Thx for pointing it out to me.
    ohenley
    @ohenley
    My problem is that I need an Ada program to be spawned by Python, not the other way around, and communicate with it. After much search, nothing seems to help as every libs/SO post/blog entries are either very shy on the subject and/or only show Ada spawns 'something'. Right now I moved to socket communication ... and I might go back to make an Ada extension to Python using Cython because the socket solution is a lot of machinery for not much... IMO.
    matrixbot
    @matrixbot
    thindil You could try also: create a C API to your Ada code and try to execute it from Python or again named pipes just this time from the Python to Ada. Often, when I'm looking for similar problems and I cannot find anything related to Ada, I'm start searching for any C solution and then I adapt it to my needs πŸ˜‰
    Simon Wright
    @simonjwright
    GNATstudio is an Ada program which has an embedded Python interpreter which it extends with classes & operations that are written in Ada. The thing that stopped me making progress was the way that extensions have to manage garbage collection explicitly; there was something in the Ada/the bindings/the version of Python (3.8.5)/macOS that resulted in a GC-related crash before the program even completed startup. You might have more luck if the extensions have a very simple interface. You might have more luck anyway!
    ohenley
    @ohenley
    To give you context, inside 3dsmax we are launching many heterogenous subprocesses (Python TensorFlow routines, compiled C++ 3D heuristics etc) that are CPU bound and long-running ... from Python (don't ask it was not my decision to use such absence of architecture. Everything is IO base, its the party of passing command-line options/data around ... for 'flexibility'). Thing is, a DCC software end-user needs to be able to cancel a long-running operation (oops I do not want to wait 1 minute for such 3D filter, cancel button). Now you try to abort a CPU bound, non-deterministic, and long-running subprocess in Python. Forget that, well I did not find how, everything ends up either non-responsive, blocking, or when interrupted the world hangs (Python false thread, subprocess polling, asyncio loop, Qthread ... I think I tried everything and nothing makes the cut. Maybe it is the quality of the information on how to drive such features coupled with my average understanding of things in general). Therefore I tried to wrap such CPU bound process inside an Ada parent task 'select ... then abort' with a cancel trigger wrapped in a protected entry call and it works wonder. It aborts the process instantly. Therefore I need Python to call Ada that will run task wrapping/ spawning some Python and C++ CPU bound subprocess and control their complete execution or their async cancellation. If it works, I could say Ada set a foot inside Autodesk and saved Python ... and C++ (do not worry for licensing, its only internal R&D proto stage, we will rewrite everything in C++ and no Ada will be shipped. It would be way too ... how they say ... disruptive to do so. People would melt under the presence of 'end if;')
    matrixbot
    @matrixbot
    thindil ohenley (Gitter): Looks like the classic "Dinning Philosophers problem" πŸ™‚ You could give a try one of Python versions of Expect (which was created to manage subprocesses and it is often used by sysadmins) https://en.wikipedia.org/wiki/Expect Just this will be another subprocess to care.
    ohenley
    @ohenley
    Ok my 'select then abort' is overkill. with a non-blocking spawn and pid I can kill the python subprocesses at will.
    @reznikmm https://github.com/reznikmm/spawn is a fork. Could you enable the issues section in the settings of the repo?
    ohenley
    @ohenley
    @reznikmm when you can, please take a look at AdaCore/ada_language_server#576. Thanks.
    Maxim Reznik
    @reznikmm
    @ohenley I'll see. Could you meantime try to run testsuite/spawn/spawn_test.adb ?
    ohenley
    @ohenley
    @reznikmm I did, same result. Nothing outputs, program resume.
    Maxim Reznik
    @reznikmm
    @ohenley strange, what compiler do you use? GNAT Community 2020?
    ohenley
    @ohenley
    @reznikmm Tried both GNAT-CE 2019 and 2020.
    Maxim Reznik
    @reznikmm
    spawn is built as a shared library, so you need libspawn.dll in the PATH. Beside this I can't see any issue on my WIndows virtual machine :(
    ohenley
    @ohenley
    Yes, cmd reminded me of this and even with the dll next the main executable it is was not working. Ok let me try again with explicit path inclusion.
    ohenley
    @ohenley
    @reznikmm spawn_test is working. I must have tripped either on the wrong .exe expriment, wrong dll placement, the absence of output on the default code path. My bad, thank you for your time and sorry for the inconvenience.
    Maxim Reznik
    @reznikmm
    @ohenley You are welcome. Thank you for trying this. I'm unable to open issues on a fork repo. I'll try to move it under AdaCore GH organization
    ohenley
    @ohenley
    image.png
    @reznikmm Yeah something is fishy. I can literally break my machine. I will try to reproduce. P.S. : Phew, I am not crazy. :) ... it looks liike a fork bomb .
    Maxim Reznik
    @reznikmm
    :(
    I didn't expect that some one starts this test with an argument :)
    14 replies
    ohenley
    @ohenley
    Can someone explain to me why I am fighting -gnatyyO in GNAT Studio? I try to set -gnatyN in the Edit -> Project Properties ... -> (replace -gnatyyO by -gnatyN, then save). -gnatyyO keeps getting back.
    Micah W
    @micahwelf
    I haven't looked for many months, so sorry if I am mistaken, but I believe that is a glitch in GNAT Studio? My experience has been that the options are automatically added or taken away when you use check-box options. Manually adding options is supposed to be detected and reflected in the check-boxes or left as-is when you add something more than what is covered by the presented options. It seems to me that either -gnatyN is not supported on purpose or that it is a glitch in handling it. Since nearly everybody wants some level or sort of style checking so their code is readable, it my assumption that it is just an oversight or a glitch.
    Micah W
    @micahwelf
    @matrixbot As was said, you probably have to compile it yourself. To do that, you might find it easiest to start on x86_64 with the Arch Build System package files. Once you have your starting point to build your Ada support package (s), tweak the target architecture and the package details to reflect it, then run your build commands to create a package for ARM64. The details should be documented in package documentation, Arch Wiki, or self-evident. Compilers are typically cross-compiled within a distribution (base of libraries) if the target platform is supported, so I wish you good luck.
    ohenley
    @ohenley

    @micahwelf Thx for the confirmation. "Since nearly everybody wants some level or sort of style checking..." I would disagree here, not by default. People who know what they want as 'style constraints' should and are welcome to increment the requirements as they see fit , as they move up the 'seriousness' of a project, not the other way around. Do not get me wrong, I like my code well formatted when I make a formatting session, not forced on me at every turn.

    Starting a project with -gnatyY is mind bogglingly unwelcoming and is just IMO, 'baroque friction' stuck into 'container/formalism fetishism' salted with unhealthy control issues . E.g. I wanted to quickly try a 3rd party Ada project, the compiler imposed on me to add 'overriding' everywhere (fine its semantic, not styling) and then it choked to compile complaining the addition of this 'overriding' was making a line more than 80 characters long. Styling has nothing to do with code correctness. Have you ever seen 'The Twelve Tasks of Asterix', the house that sends you mad; same thing. I had to stop the world and launch a Google search campaign to figure out what to feed the compiler or the project manager just to move on ... because some Ada 'I know the manual by heart' decided to set -gnatyY by default under a glichy IDE. I almost dropped everyhting.... because time is time. Its important, I have better things to do than fight meaningless aspects of a programming language my employer is not interested in me putting time anyway.

    Someone knows how popular is Ada on stackoverflow or how many blog posts we find around talking about quick and dirty pain points of the GNAT compiler options: practically none. Would I be presumptuous to say that most people are not interested in 'reading the full manual' for a technology many would argue is half dead? Do we have the luxury to annoy new commers and hobbyist with such opiniated road blocks? Who asks himself why people are massively moving to Python and Node? Because of sugar. This, along the annoying fact that obj, bin etc. folders are not created by default when missing is ANTI-sugar.

    Now the joke is on me because such peculiar details, '-gnatyN', will be erased form my memory in 2 days and I will run into it again in 2 weeks swearing 'what was it again that monkey trick ..?' Now if ones need a cheatsheet to have happy days using Ada, do not wonder why we do not make the TIOBE index.

    Ada is wonderful core technology but a lot of the 'Ivory tower' mentality surrounding it is, in my opinion, what have almost put Ada to its knee and should be confronted vehemently. The critical mass Ada needs is in everyday coders, not just the engineer in suits making avionic unit test with exact < 80 characters per lines from the get go... because by night they by in Rust, C++2059, etc. All of this is pure common sense. Thank you for reading.

    @micahwelf I finally found the '-gnatyN' option, add it to the project file

    package Compiler is
          for Default_Switches ("Ada") use ("-gnatyN");
    end Compiler;

    and it did the trick to stop picking on me for ... styling.

    Maxim Reznik
    @reznikmm

    there is also pragma Style_Check. May be it's easier to remember then the compiler option.

    https://docs.adacore.com/gnat_rm-docs/html/gnat_rm/gnat_rm/implementation_defined_pragmas.html#pragma-style-checks

    ohenley
    @ohenley
    @reznikmm Thank you, I will try to add it to my Ada diet. :)
    Maxim Reznik
    @reznikmm
    @simonjwright I would add a GitHub Action CI to GtkAda repo. How can I install gtk on Mac OS X?
    onox
    @onox
    @ohenley I've posted a response to your comment about binding project's descriptions in https://github.com/ohenley/awesome-ada/pull/58#issuecomment-710808889
    ohenley
    @ohenley
    Super. Sorry I totally missed that last message. Thank you for bumping I will answer there.