What language should I use for an IF coding tutorial?

I’ll put you down for C, then. Actually, not including graphic, C has better string handling, data structure and flow control than BASIC. I’m thinking of using programmable calculator, but be honest, I don’t think there’d be anybody besides me who will be interested.

The point here is to prove coding IF is easy enough without having the language do it for you. Sure, using TADS will be much, much easier. However, any success will be attributed to the language instead of the technique. Hence, missing the point.

I think that’s already been proven in the 1980s. You won’t be covering any new ground, but I’m sure it will be personally interesting to you.

2 Likes

Yeah. It may be selfish of me, but I want to see more Paul Panks. Thanks for commenting.

1 Like

I’m more interested in homegrown games and systems than Inform et al. ones, so don’t take that comment the wrong way. It was just a response to say, yes, coding a basic IF system is relatively easy as was shown many times in the 1980s. Coding something at an Inform sort of level, is a lot more challenging, but there are still plenty of examples of 1980s/1990s single-person coded “own” systems with complex sentence processing power.

2 Likes

So, uh, can I put that down as “Other (programmable calculator)”? :grin::wink:

1 Like

In my experience, when you learn a new language that’s similar to C (be it TADS, Java, C# and whatnot), you don’t have any real difficulty learning the actual language. The majority of the time is spent learning the APIs (like adv3 or .NET.)

A C-based authoring system would still have an API you’d need to learn. The fact that you’re using a language you already know doesn’t really seem to make it that easier.

3 Likes

These days no one should start by learning C IMO. There are just too many footguns. If you don’t want an interpreted (or JITed) language like Python or Javascript, then why not Rust?

2 Likes

Why not Go? C++? C#? Because of all “C like language”, C has the most platform penetration. Even as recent as 1.5 years ago, I’d have asked, “What’s Rust?”

If we’re talking about total beginners here, my preference would be BASIC. Hey, it’s in the name! Tiny Basic used to be included, but not anymore, apparently.

C should be safe enough if I stay away from the more complex construct. In fact, I plan to use TinyC instead of GCC, keeping it simple.

C-like isn’t necessarily a good thing. Manually managing memory where all the burden of safety is put on you? Gross. No one should have to learn that. And then there’s all the other issues - like uninitialised variables and undefined order of parameter execution, those two tripped me up recently and I’m a very experienced software developer. So many things that the compiler should be catching for you. And some C compilers will warn about some of them, but you’ll have to learn to turn on a bunch of fiddly and inconsistent compiler switches.

If you’re talking about C-like syntax, well that’s the easiest thing to learn. If you’re thinking about what to teach beginnings, I wouldn’t focus on which syntax will be worth using the longest, because it’s easy to learn, and because the similarities are limited once you move beyond function definitions. Would be worth consider Scheme or another Lisp too.

2 Likes

If you feel that strongly about it, please vote for Perl. It has the best error recovery system. Do you understand now why I put choices up there that aren’t necessarily low level?

BTW, Processing is there because that’s my answer for generic programming language since BASIC fell out of favor.

Let’s not talk about LISP. :face_with_raised_eyebrow:

Perl is a bewildering parallel-universe version of programming. You can write clear and readable Perl, but I don’t see much of it. :wink: I wouldn’t recommend it purely because of having to manually get function arguments via shift, or destructuring, etc. Also, error handling without algebraic types is often pretty messy. I see that there is an algebraic types library for Perl, which lifts my evaluation of the language. Is it used for error handling though?

Actually algebraic types make reasoning about optional parameters so much safer that I’d probably prioritise teaching a language with native support for them over any that use null parameters. That doesn’t include TypeScript either, sadly, as you have to manually handle the tagged unions.

2 Likes

TI, Casio and Numworks calculators all support Python development.

Another thought, have you considered REXX from IBM? I first saw it in OS/2 back in the day. It is still viable and has excellent string handling capability.

Personally, I’m not a fan of Python. The whole “tab” issue is a pain in the neck.

1 Like

I think the most confusing thing about this conversation is that you just wanna do this one of the languages you know well, which is fine, but the “reasons” you provide to do it in C just don’t add up.

If you mean “code written in C will run on the most platforms,” I think that’s not true today. You can’t deploy C code to iPhone or iPad unless you buy a Mac and pay Apple $100/year. You can write JavaScript for free, targeting everything with a browser, and everything else that supports Node.js (which includes pretty much every Unix you’d care to run on).

You can deploy Rust code everywhere you can deploy C code, without having to debug memory corruption. You may not be too familiar with Rust, but today, it’s just better than C for all of the things that C does, and if you’re educating a coding newbie by introducing them to C as their first language, you’re not giving them the best possible coding tutorial.

Today, in 2022, none of the languages on your list are very good starter languages. C, Basic, and Perl are all past their prime; learning them as a coding newbie limits that newbie’s potential, rather than expanding it. Processing should be understood as a domain-specific language for drawings; it’s as unsuitable to developing IF as Inform would be to dynamically generating images.

Instead of saying “C has the most platform penetration,” I think you should say, “Look, I’m familiar with C, Perl, Basic, and Processing, and of those languages C has the most platform penetration. Objectively, Python, JavaScript, or Rust would be “better,” but that would require me to develop expertise in Python, JavaScript, or Rust for this, enough expertise to teach one of these languages, and I just don’t feel like learning a new language for this project.”

And that’s totally fine! It’s your volunteer project; you could even do it in Lisp if you wanted to, just for fun!

Just don’t attempt to persuade us that C is best for what you’re working on, any more than Lisp would be.

3 Likes

Uh, hello? If you don’t want me to use C, then don’t vote for it?

Look, the whole project is to prove that coding IF is so easy, it doesn’t matter what coding language you’re using! If I put out a code that people find confusing, then that is a valuable data point, in and of itself. That is the point of the whole exercise!

You do realize that the survey lets you pick multiple languages, right? The use of one doesn’t prevent another. If you want to convert my C/BASIC/whatever language to (insert your favorite language here), I will thank you for it.

Now, if you want to argue that C isn’t usable by beginners, then I disagree because I learned real quick to change my coding style to handle C language “inadequacies”. But that is a separate thread, okay? Don’t discuss it here, please.

This whole discussion has gone in a not-very-useful direction.

You said at the beginning:

Python and Javascript aren’t viable choices at this time, due to too high level of abstraction. Any machine language, if used, will be VM and designed by me.

If that’s true, then Perl, Processing, and BASIC are also too high-level. You’re asking about C. Use C. If you don’t want to use C, figure out what you do want – we can’t help with that.

Writing a simple two-word IF parser takes a few days. That’s why there were so many simple two-word IF platforms in the 1980s.

Writing a solid, fully-featured IF parser system that other people will want to use takes months or years. If you want an idea what that development process looks like, look at the threads about Dialog on this forum. That’s about three years of development by now.

5 Likes

So, I’m curious what I will get for a few weeks of effort. Something in between? Life isn’t black and white. Life is shades of grey.

Yeah, the discussion about language is so bad, I had to flag it as off topic. I really don’t care what language to use, really. That’s why the survey is there. You can pick any or all languages. Is that so hard to understand?

I personally consider C to be of higher level than BASIC, and I’ve written the reasons why. Regardless, who cares about what language is higher levels?

If the choice of language is up to me, I’d choose Processing/SmileBasic and I’ve told you why. What I want to know is what language other people are using to write their code. What language you’re using to write your code. I cannot choose a language for you. You can choose a language for me. That’s why I have to make the survey. Why is it so hard for you to understand that?

If you have a favorite language that is not listed, then choose Other (specify) and that’s it! Don’t try to convince me, or anybody else for that matter, that your chosen language is superior, or worse, that my chosen languages are inferior. That’s the way to language war.

The fact that I have to explain this, well, it’s just so disappointing, you know?

No, I didn’t. I’m pretty well set regarding it.

Edit:
PS: Javascript isn’t off the table. It’s just that it’s not a consideration at this time . I wrote that, right? Right? Sigh.

I think what everyone is trying to say is that this is your pet project. You’re the best person to decide which language to use. I think it’s safe to say no one believes that using any of the languages you listed is a viable option for a new, modern IF authoring system.

But that doesn’t seem to be what you’re trying to build and you have your reasons for sticking with your initial selection. That’s fine, but the forum can’t help you here. And you’re coming at it a little bit aggressively.

Do your thing and share with us when you have a proof of concept, how about that? :grin:

1 Like

Why do you confuse the matter still? You are not helping! The proof of concept, as you say, will need to be coded in a programming language, and I’m trying to find which ones to use!

Or are you telling me that if I code it in, say Rust, then lots of people will be able to compile it on their machines? You don’t know that!!!

I’m not writing a compiler here. The games will be coded the hard way. It’s a language agnostic design! That’s what coding from scratch means.

Is the concept so foreign that no one here can understand it? Hello?

Who’s doing that? Not me. Don’t drag irrelevant subjects! Sigh.

Edit:
And that’s even assuming I can actually compile Rust on RPi, since there’s no specific build for it, and the best advice is to just do cross compilation to RPi. Hmmmph!

C/C++ compiler? Gcc. C compiler? TinyC. Easy. Perl is built-in. Processing, you need to install, but it’s relatively seamless. You can do it via PiApp.

And in case you missed it:
THAT’S WHAT CODING FROM SCRATCH MEANS!
Sorry to be aggressive, but people just keep pushing their views onto me. Extremely, extremely, extremely frustrating.

What kind of IF are we talking here? Parser? Choice?

Here is a suggestion; do your project in a language agnostic way. Explain the concepts, program flow and potential tricky parts. Do it in psuedo code or on an even higher conceptual level.

Then you implement it in one or two languages of your choice just to showcase how easy it is.

(During my school years we used Pascal. It is strongly typed and presumably it teached you good coding habits. So use that…)

3 Likes

Parser. Of course I’ll use Pseudocode. It’s the implementation stage that I’m having trouble with. I probably will end up using C, even though I like Processing/Perl, just because I think it’s what lots of people can use, albeit not their preferred language.

I know Pascal. I don’t believe that’s a good language to teach to beginners. I’d sooner use BASIC than Pascal. Sorry.