Programming General
#1
Programming General
I figured after some thought today, we could use a good programming thread. Show off what you're working on, talk languages, ask for help, etc. It all goes here. 

I myself have been delving into lua and tcl and I like both languages. They're both easier than Ruby, which I also like. 

Generally, after growing up and learning that languages aren't gonna be perfect, I tend to rate them this way:

Compiled languages:

Top languages: C, C++, Modula-2, Free Pascal

Bottom languages: Rust, Ada

Reason why I've rated Rust low is because the API isn't stable between versions, much like Python, which I'll probably briefly rant on later, and because it has freedom issues because Mozilla aggressively polices its Rust trademarks. 

Ada is because GNAT requires runtime linking against the GCC Ada library, and thus if you statically link, the project must be GPL. This doesn't appear to be as much of an issue on C++ or C based GCC programs. 

Scripting languages:

Top: Lua, tcl, ruby
Mid: Python, Perl
Bottom: Javascript, ReXX (especially aReXX)

Javascript sucks ass, enough said.

aReXX was annoying to try coding for, and I gave up due to its rather obtuse syntax and lack of free documentation at the time. 

Python I can't recommend if you don't need Django or any of Python's wonderful libraries and modules. It's not a terrible language, but the Python 2-3 thing is a problem, plus their codebase, performance and portability aren't good. 

Perl I like, but the fact is a lot of Perl, including my own, is write-only stuff that I do when drunk and when I'm sober, it's like "why the fuck did I do it this way???"

Web languages: 

Top: PHP, Ruby
Mid: Hack
Bottom: Java, Javascript/node.js

Node is just javascript for the web and other stuff. 

Hack, I want to like, but the breaking of PHP compatibility and lack of a good overall environment for it limits its usability.

I rated PHP, despite its warts, known security issues, etc. high because it's well-supported, and it's gotten considerably better with PHP 7.0+ 
Ruby on Rails is so good, that Laravel, Cake, and many other PHP MVCs try to mimic it.

Assembly:

Top: M68k
Mid: VAX, PDP-11, 
Bottom: any RISC assembly language, x86/x64

I coded on M68k a lot in high school, not because I wanted to, but because I was an amiga enthusiast. I made a few programs in it, and among them were:

1. A hard-coded, square wave rendition of Herzog Zwei's Loch track (it was terrible sounding on Paula because Paula is kind of nasty to code for)
2. A missile command 2600 clone for the Amiga. This took me nearly two months of assembly to do. Among the issues:
  • Memory leaks like a sieve. I got the main ones, so it worked up until level 8, and then the counter auto-incremented and rolled over, and corrupted part of the exec hunk (Amiga memory layout was kind of annoying) If I did it over again, I'd have probably tried using some of the routines in exec instead of trying to keep the memory fixed in a layout that wasn't ideal. 
  • Paula's interrupts for the noise the planes and satellites caused jumpy movement, so I basically didn't implement any noise for them.
  • I only primitively drew graphics, so the routines were slow, stilted, and didn't use any macros. 
  • The key commands were hard coded. It was: arrow keys to move, z,x,c to fire each base's cache of missiles. 
  • It crashed constantly. The biggest issue was that the memory map of the Amiga is even worse than the C64, and bank switching isn't really an option if you want quick routines. That is, at least in my experience it took 4 cycles to bank switch. 
I sadly don't have the code to these anymore. I programmed them in E-UAE on a powerbook G4 that ended up pretty badly beaten, and being the immature young adult I was, I not only neglected backups, but saw no value in my hard work. 


I want to like C#, but it and Java annoy me due to their runtime/hosted aspects being very CPU-specific. In my opinion, the time I could save coding in C# would be better spent writing a C++ program and then tweaking it to work on all the OSes/platforms I need it for.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
03-23-2020, 06:39 AM
#2
RE: Programming General
I use Python in Maya a lot. But that is pure scripting for cutsom ui and tools. It is fully dependent on knowing Maya's own language MEL (maya encoded language) to be able to make it do things.

I dabbled in C++ coding for mods for quake and quake 2 and did create a rocket area clone for a q2 game called Kingpin that I named Riotz. Its just rocket arena round based elimination style for Kingpin.

Both times in mods and maya I primarily use the most basic of programming functions

saving variables for strings, int, float, arrays...
using them in
for loops
if/ else if

In Python I liked using definitions to streamline the scripting calls but as soon as I got to classes I started to find my limitation was entirely due to my needs.

Python 2 was what I primarily used in Maya but now as of 2020 Maya it is Python 3 so I would need to rework a lot of stuff. At the moment I am still on 2019 at home.

Octane 2x400O2 300O2 400Origin 200 2x250
Intuition
Tezro

Trade Count: (0)
Posts: 351
Threads: 42
Joined: Dec 2017
Location: Roseburg, OR
Find Reply
03-23-2020, 07:58 AM
#3
RE: Programming General
Heh, okay...

As far as "real" programming languages go...C, all the way. I just like the no-bullshit what-you-say-is-what-you-get approach to programming; yes, it will do almost nothing to prevent you from shooting yourself in the foot, but that's a great way to learn not to do it in the first place. I'm a better programmer now for all the screwups I've made over the years that C forced me to stop and really think about.

As far as scripting languages go, my go-to for quick hacky utility stuff is FreeBasic. It's a bit janky and code generation is way suboptimal, but for getting from point A to point B as quickly and easily as possible while still working in a vaguely sane, sensible language, it's a damned nice solution.

I do also rather like Python for the breadth of its library support; if I need to throw together something in a pinch that needs to, say, read in a CSV, munge the data, and spit the result out as an HTTP request to some third-party server (actual thing I've had to do,) Python is without a doubt going to be the simplest way to do it.

For "languages I most admire the design of," it's a tie between Smalltalk and Forth. The one is an elaborate self-reflective-object-model-atop-a-VM design while the other is a bare-bones close-to-the-metal stack-machine meta-architecture, but they share a similar fanatic dedication to boiling everything down to constructed expressions of a singular core concept. I dig that.

Getting down to assembly language...yeah, 68k and PDP-11 are just pretty damn nice, but I've also developed a fondness for some of the more minimalist designs...the 6502, the PDP-8, the DG Nova. Granted, I've never had to do anything with these on a timeframe, but there's a certain appeal to the way they turn programming into a kind of puzzle game - sure, you can always brute-force your way through the problem, but can you figure out a good solution instead? As I dabble here and there with the idea of trying my hand at a CPU design/implentation project some day, I find myself leaning more in that direction...

Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, E-mu Proteus/2, Nord Lead 2, Behringer Model D
(This post was last modified: 03-23-2020, 08:08 AM by commodorejohn.)
commodorejohn
PDP-X

Trade Count: (0)
Posts: 367
Threads: 7
Joined: May 2018
Find Reply
03-23-2020, 08:08 AM
#4
RE: Programming General
My professional programming carreer lately took a complete turn for the dark side of the force: I now work on a WinForms / C# / .Net product. Before that it was C++ with Qt on Windows, with OpenGL graphics and hand-tuned threading and such stuff. Boy, do I love that!

Most of that C#/.Net stuff is ok, but I despise the amount of syntactic sugar that comes with those modern languages. I mean, what's the point of writing "myObject?.doStuff();" instead of using the actual ternary operator with something like "myObject? myObject->doStuff():;"? Is the first so much more readable? Did it save you so much typing? And if so, why don't you learn to type properly on a keyboard, or use one of those modern IDEs, with auto completion, and wiggles, and stuff? At least, every C-savvy programmer on earth would have grogged the second line in an instant, but I guess that is not the intended target audiance any more.

And I get the uneasy feeling that this whole software stack is unstable, in some hard to define way: For example, you can blow the nightly build by forgetting to save a string table in the designer, because the C# code is generated on save, instead of build. And speaking of builds: they seem a little bit unstable to me, too, failing for no particular reason, then working the next time. Strange stuff.

We had the C++ project set up so that I could diagnose a crash dump with WinDgb in seconds (provided that the source code for that release was already on my machine, which usually was the case). Even if you couldn't fix the problem yourself, it was usually possible to assign the problem to a person with deeper knowlegde of the involved code, who could then start fixing it with most relevant facts already known.

But I guess that will be the "good old days", when I look back in a few years...

Oh my, that already got more of a C# rant than I originally intended (and I didn't even touch TFS).

So, back to topic.

Here is my personal hierachy of programming languages:

Top: C++ (11, 17, you name it)
Follow-Up: C
<much space in between>
Mid: Java, C#
Bottom: Javascript, python, shell scripts... (for some strange reason, I like perl, though...)

Regarding asm, I'm somewhat fluent in reading x64 assembly, which came with front-line debugging release builds for years. That's ok, it has been the dominating desktop ISA for decades. Love it, change it, or leave it, as they say. Of the RISC ISA's, I find MIPS particularly nasty, with branch delay slots and stuff like that. And since I'm an Alpha nerd, I have seen a fair share of Alpha assembly, too, and I do not find it too hard to grasp. Nice, clean architecture. Though debugging can be a pain, with imprecise exceptions.

"The early bird gets the worm, but the second mouse gets the cheese!"

SGI: Octane MXE, O2, Fuel (defunct), VW320 (defunct)
DEC: PC164, PC164SX, AXPpci
sgt_barnes
Octane

Trade Count: (0)
Posts: 101
Threads: 1
Joined: Mar 2019
Location: Germany
Find Reply
03-29-2020, 11:11 AM
#5
RE: Programming General
Yo,
I'm actually, for all intents and purposes, a professional Ada programmer. I've been developing a Desktop application (90% Core Code in Ada, with WxWidgets UI based in C++), written entirely by myself, for nearly 7 years. Compiling/Running on both Windows 10 x86 and Apple Mojave x64 using Ada 2012 at this moment into a static executable.

I've developed my own bindings to Win32 C++ APIs and UNIX C APIs, for both Filesystem and Networking interfaces (had too for reasons below). So I've done more than a small amount of C/C++ language interfacing to other libraries. I also correctly use the GCC G++ linker with Clang and MacOS LibC runtimes entirely (no libstdc++ components anywhere in MacOS) to link mixed source applications using GPRbuild tools.

I only comment to correct the statement that Ada GNAT is GPL linked and forces you into a GPL license. This is a common misconception that Adacore likes to keep going, but it's not true. I will explain for the benefit of all in this topic.

Free Software Fundation (FSF) GCC compilers licensed under GPL 3 have a "runtime exception" clause: https://www.gnu.org/licenses/gcc-exception-3.1.en.html

This basically states that linking against the standard compiler runtime in the final executable isn't the same as linking against a third-party GPL library at the OS level. It's different and is an exception to the linking rule for FSF GCC compilers. Your code doesn’t become GPL licensed just because you use a GCC compiler to compile it (normally).

Now the confusion comes into how Adacore distributes their free compiler and tools.

When you go to Adacore and download a "free" compiler, their license demands you become GPL, they do this by removing the exception language comments in the source code (dumb), compiling the SAME free source code, and forcing you to agree to the license during installation or download. Now they have you locked in, if you don't pay them an enormous fee for GNAT Pro, they will sue you if you release your software commercially. If you use their provided "free" GNAT library, called Gnat Collection (Gnatcoll), whether with a FSF or GPL compiler, they got you again, and will sue you. They ONLY license Gnatcoll under the GPL publicly, unless you buy a private license.

If you want to develop commercial Ada code, with a GCC compiler (like me). It's a very simple task.

1. Compile or download a GCC distribution that is marked as FSF.
a. Don't ever download ANY software from Adacore, unless it's the dev-side support source (like Aunit), which isn't part of a final executable and therefore the license doesn't matter.
b. For Windows I've found MSYS2 to be the best way to get the latest GCC FSF components that work well on Windows and FSF build tools & scripts to function easily. I’ve done this for CMake, Aunit, CPPUnit, GPRBuild, XML/Ada, OpenSSL, and WxWidgets.
c. You’ll have to compile XML/Ada and GPRBuild for yourself from GitHub AdaCore source, I recently submitted bug reports that were fixed, so this should now be easy to do in MSYS2 by just following their steps to build/bootstrap.
d. For MacOS, we all use this (this guy does amazing work!): https://sourceforge.net/projects/gnuada/...%20OS%20X/

Both of these are STATED to be FSF GCC compilers with FSF submitted patches.

2. While using/learning Ada, don't ever, ever...look at, reference, and use GnatColl or Ada Web Server code of any kind unless you’re doing online, backend SaaS, where licensing doesn’t matter. Only the libraries provided by the Ada language Reference Manual (LRM) are standard and covered by the exception! Any custom source from Adacore requires an Adacore license. Now you know why I had to write my own networking and filesystem packages for each platform. If I had used Gnatcoll, they’d have me. Writing it yourself means you own it. Took several years to get it all, works fine now, and Adacore can’t say “bo” about it.


So to summarize, you can program on Android (Dragonfly FSF compiler, but Adacore JNI would cost you!), MacOS, Linux, and Windows with Ada for free, for commercial purposes, by downloading and restricting yourself to FSF compilers and only use libraries with dual licenses that allow commercial usage without reciprocity.

If someone has a counter example, by all means tell me, but I’m currently 100% confident these above statements are correct as I’ve staking 6+ years of my life on it.

For the question in everyone’s mind as to why someone would start a new program in a supposedly dead language like Ada and do all this. The answer is very simple.

I used to work with a Microsoft vendor in Redmond, WA (near main campus) for nearly 7 years. During that time, gaining experience, I thought of a great desktop application that my friends and I would totally use and need if someone actually made it (not going to disclose fine details at this time). Now I had already signed my intellectual property rights away on my employment contract. I took the leap and quit my job and then started coding (GitHub Private Micro backed-up). I had done extensive research before quitting and I needed to use a language that did several things for me:

1. I could get a free/low-cost compiler (hopefully the same compiler family) for Windows and MacOS (Linux was a maybe…it’s not too hard but it’s low priority right now to make a Linux client).
2. The compiler had to compile to a native executable, use native APIs, and require no support software on the client machine before installing/using my software.
3. The language had to have threading primitives and the strongest typing I could find. Why? Because I’m not a self-described genius, I’m likely to mess this whole thing up unless the compiler helps me. That means I need lots of compiler checking, type checking, bounds checking, blocking task checks, etc…I was new and wanted as much automated help as I could get. Java was out (bad experiences) and I never correctly learned C or C++ to use it in real-world applications (faking types without protection) without shooting myself in the foot out of the starting gate. Plus, I really don’t enjoy working in C++ syntax once templates came into the picture.
4. I wanted as much of a “single source” application as possible. Very little code would be platform specific (to help bug reports and such).
5. I wanted to attempt to use several mindsets (Micro services, package models, contract programming models, etc).

Well, all I could find was GCC compilers, running Ada…so that was the answer. Rust wasn’t out for all platforms yet (but if I were to do it today, I’d likely chosen Rust, wasn’t possible in the past). Swift never had Windows compilers. So Ada was the logical choice to satisfy those requirements.

I’ve never regretted it, I’ve had to learn the language paradigm (read 80’s books on Ada when the language was new and the most recent texts). Took a while to understand the shortcomings, design mindset, and expected usage of many of the Ada features. GCC also crashes or has issues doing things that are technically not disallowed by the LRM, but I guess it’s not correct usage to do things like nested selects or ATC inside a passive task, etc…got a lot of crashes.

Once I got a handle on passive versus active task termination problems, backwards finalization of tasking scopes (parents finish before children and can naturally yield but won’t finalize any of their (now invisible) objects before any children finalize their objects, make signaling a pain if you have a dying parent trying to signal an active-tasking child, if child was passive you could just do a rendezvous, can’t with active tasking), requiring using custom counting semaphores to guard reiterate object finalization in threaded applications (ifs and null access checks don’t work! Ada may re-run an object’s destructor multiple, partial, times which don’t always set conditionals to guard against multiple finalizations), access type lifetimes, and generics (especially nested generics!). Everything else made sense when I read it.

Now that I have good handle on them, I enjoy using Ada (less its online library services limitations), after nearly 7 years I’ve only spent about 3 days of total time in GDB, finding bugs. I spend so little time messing with real technical problems (versus logical ones) that I love working in Ada! It’s a shame most companies won’t invest in using Ada, so far the stated rewards of reliability, readability, and maintainability weren’t exaggerated. I’d never go back, If given a choice.
weblacky
I play an SGI Doctor, on daytime TV.

Trade Count: (10)
Posts: 1,716
Threads: 88
Joined: Jan 2019
Location: Seattle, WA
Find Reply
03-31-2020, 10:53 PM
#6
RE: Programming General
I actually didn't know that the situation was far more complex. I thought because Ada's libraries and runtime are also provided by GCC, that the FSF mandated GPL. Glad to see that I was wrong on that account. But I still would probably focus on Modula-2 over Ada just because I have some exposure to that.

Thanks for clearing that up. IRIX does have an Ada95 compiler around here somewhere, I used to own the CD but sold it.

I personally have zero desire to ever code in Windows or macOS, if I ever release the game engines I'm working on (they're toy engines, moreorless) then I would probably say people would need to fork to get macOS or windows patches into it. I hate the overall paradigm both OSes bring.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
03-31-2020, 11:31 PM
#7
RE: Programming General
(03-31-2020, 11:31 PM)Raion Wrote:  IRIX does have an Ada95 compiler around here somewhere, I used to own the CD but sold it.

That's GNAT 1.3 I think -- very old. I used to build GNAT as part of GCC on a regular basis. It's a bit of a chicken-egg problem because the compiler frontend is written in Ada, which means you need GNAT to build GNAT. :dodgy:  This makes bootstrapping a new platform a royal pain.

Anyway, the binaries are probably still on my O350, should someone want to build Ada code on IRIX or bootstrap his/her own toolchain.
jan-jaap
SGI Collector

Trade Count: (0)
Posts: 1,048
Threads: 37
Joined: Jun 2018
Location: Netherlands
Website Find Reply
04-01-2020, 03:40 PM
#8
RE: Programming General
(04-01-2020, 03:40 PM)jan-jaap Wrote:  
(03-31-2020, 11:31 PM)Raion Wrote:  IRIX does have an Ada95 compiler around here somewhere, I used to own the CD but sold it.

That's GNAT 1.3 I think -- very old.

Archive.org has the SGI Ada compiler 1.3 CD image for download.

And there is http://sgifiles.irixnet.org/sgi/Ada/ for Gnat 3.09.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
04-02-2020, 11:34 PM
#9
RE: Programming General
Yo,
Yeah I was aware of that. I also bought the CD from Ian 10+ years ago. Though as I posted in the Wanted Software section. Apparently Gnat 1.4 for Irix exists (saw a CD with it on a foreign eBay auction page). So I'm hunting that if anyone runs across it. I'll pay for just a copy of the Gnat 1.4 CD.

Also if anyone ever get GCC 4.7 (I thought that as the last version for Irix?) with Ada support, I'll pay for that too!

Thanks
weblacky
I play an SGI Doctor, on daytime TV.

Trade Count: (10)
Posts: 1,716
Threads: 88
Joined: Jan 2019
Location: Seattle, WA
Find Reply
04-03-2020, 01:58 AM
#10
RE: Programming General
GCC 4.7.4 is the last to profess official support for IRIX. However, Ada had been broken for a while prior, and was labeled with "wontfix"

GCC5+ have been unofficially backported by Erno Palonheimo and others.

I've never tried building GCC5 with ADA support. I can this weekend, but I have zero confidence that it'll work. There's some weirdness with C++11 in GCC5 for IRIX, but as I'm not a github user, I can't really properly tell if it's a bootstrap issue, a compiler issue, etc.

I am hoping Eschaton or someone else works on LLVM so that we can start getting LLVM's tools working under IRIX. Unlike GNU, LLVM has said they will upstream.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-03-2020, 02:14 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)