Microsoft debuts Bosque – a yet another pointless programming language



  • @Gurth There's a gorn in my star wars.


  • Banned

    @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    Imagine you have 60 of these. Let's say you want to change one thing and now have to fix layout in 30 other places. Which code style will be easier to work with?

    Of course you misunderstood it. That initialization is a one-time thing used for drawing the map, there are no 60 instances of it, and it is not copied in other places. As such, it is a totally irrelevant example.

    This map doesn't exist in isolation. It's integral part of the entire game, and one of the more important ones, interacting with most of the rest of the game. I'm not talking about having 30 identical copies of the exact same object - I'm talking about having 30 different objects all over the place that need to be updated simultaneously because the feature you want to add requires a coordinated change in 30 different things at once. Bread and butter of software development.

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    @levicki and as was totally expected, the nicety of natural language falls apart completely as soon as you introduce conditional statements:

    Did you even try to understand what that code does? Why do you think it is less readable than your average foreach loop?

    It is not less readable than your average foreach loop. It is exactly as readable as your average foreach loop. Because it is your average foreach loop. And that's the problem.

    Why didn't you copy a part showing the natural language usage such as the one right above that?

    Because I wanted to show how natural language usage doesn't work with conditional statements. It would be pointless to copy code that doesn't contain conditional statements.

    The initial appearance of a door is usually "Nearby [an item described] leads [item described direction]." The description of a door is usually "[if open]It stands open[otherwise]It is closed[end if][if locked] and locked[otherwise] and unlocked[end if]."
    
    To say (item - a thing) direction:
    	let place be a random room;
    	let the place be the other side of the item;
    	if the place is visited, say "[way through the item] to [the place in lower case]";
    	otherwise say "[way through the item]".
    
    Instead of attacking a closed door: say "[The noun] reverberates but does not open."
    
    Understand "knock on [something]" or "knock [something]" as attacking.  Understand the commands "bang" and "tap" and "rap" as "knock".
    
    Before printing the name of an open door (called target) when looking or going: 
    	if the target is a staircase, do nothing;
    	otherwise say "open ".
    
    To decide what direction is the way through (threshold - a door): 
        let far side be the other side of threshold; 
        let way be the best route from the location to the far side, using even locked doors; 
        if way is a direction, decide on the way; 
        decide on inside.
    

    To me this is very readable.

    If you read it like prose - from beginning to end, just to know what it contains and without any particular goal in mind - then yes, it's very readable compared to regular code. But if you read it like code - jumping randomly between function using Ctrl+F and other tools for searching through code, listing inputs and outputs of the function, looking for the right place to insert your modifications, doing regex-find and regex-replace over entire codebase for various reasons - I'm not convinced it helps with anything. I'm 99% sure this language is in the same category as every other programming tool designed for non-programmer - it's very easy to start and everything looks simple and easy, but spend enough time working on complex projects and you'll lose all your hair.

    Also, how much code and structures would be needed to write this:

    The Lie Library is north of the Black Gallery and east of the Smoke-Damaged Chamber.
    

    Depends on language. My day job is working with Datalog, so I'll give you an example in Datalog:

    is_in_direction("Black Gallery", "Lie Library", "north").
    is_in_direction("Smoke-Damaged Chamber", "Lie Library", "east").
    

    (Screenshot instead of copy-paste because the website implements code indentation as CSS classes and it's missing in copied text and it looks shit and I'm too lazy to fix it.)

    You are too lazy to even read. You missed a large link named "Complete text" leading to the source code which you can copy/paste to your heart's content.

    Why would I ever click something called "complete text" if I am not interested in reading complete text, but in copying the thing I already have on screen and don't need more of? I had zero reason to think it would be at all useful in solving my problem of code on page not having real indents. If the link was called "click here to read raw code without any fancy HTMLish formatting for easy copy and paste with all indentation preserved", I'd be more inclined to click it before complaining about missing indent.

    @Gurth said in Microsoft debuts Bosque – a yet another pointless programming language:

    They’ve pretty much reinvented AppleScript, by the looks of it, but without colours in the editor.

    Inform7 is much more capable than AppleScript.

    Isn't it very domain-specific - basically useless outside text adventures?


  • area_can

    http://shakespearelang.sourceforge.net/

    Hello World!

    (This is the contents of the file hello.spl.)

    The Infamous Hello World Program.
    
    Romeo, a young man with a remarkable patience.
    Juliet, a likewise young woman of remarkable grace.
    Ophelia, a remarkable woman much in dispute with Hamlet.
    Hamlet, the flatterer of Andersen Insulting A/S.
    
    
                        Act I: Hamlet's insults and flattery.
    
                        Scene I: The insulting of Romeo.
    
    [Enter Hamlet and Romeo]
    
    Hamlet:
     You lying stupid fatherless big smelly half-witted coward!
     You are as stupid as the difference between a handsome rich brave
     hero and thyself! Speak your mind!
    
     You are as brave as the sum of your fat little stuffed misused dusty
     old rotten codpiece and a beautiful fair warm peaceful sunny summer's
     day. You are as healthy as the difference between the sum of the
     sweetest reddest rose and my father and yourself! Speak your mind!
    
     You are as cowardly as the sum of yourself and the difference
     between a big mighty proud kingdom and a horse. Speak your mind.
    
     Speak your mind!
    
    [Exit Romeo]
    
                        Scene II: The praising of Juliet.
    
    [Enter Juliet]
    
    Hamlet:
     Thou art as sweet as the sum of the sum of Romeo and his horse and his
     black cat! Speak thy mind!
    
    [Exit Juliet]
    
                        Scene III: The praising of Ophelia.
    
    [Enter Ophelia]
    
    Hamlet:
     Thou art as lovely as the product of a large rural town and my amazing
     bottomless embroidered purse. Speak thy mind!
    
     Thou art as loving as the product of the bluest clearest sweetest sky
     and the sum of a squirrel and a white horse. Thou art as beautiful as
     the difference between Juliet and thyself. Speak thy mind!
    
    [Exeunt Ophelia and Hamlet]
    
    
                        Act II: Behind Hamlet's back.
    
                        Scene I: Romeo and Juliet's conversation.
    
    [Enter Romeo and Juliet]
    
    Romeo:
     Speak your mind. You are as worried as the sum of yourself and the
     difference between my small smooth hamster and my nose. Speak your
     mind!
    
    Juliet:
     Speak YOUR mind! You are as bad as Hamlet! You are as small as the
     difference between the square of the difference between my little pony
     and your big hairy hound and the cube of your sorry little
     codpiece. Speak your mind!
    
    [Exit Romeo]
    
                        Scene II: Juliet and Ophelia's conversation.
    
    [Enter Ophelia]
    
    Juliet:
     Thou art as good as the quotient between Romeo and the sum of a small
     furry animal and a leech. Speak your mind!
    
    Ophelia:
     Thou art as disgusting as the quotient between Romeo and twice the
     difference between a mistletoe and an oozing infected blister! Speak
     your mind!
    
    [Exeunt]
    


  • @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    To me this is very readable.

    Readable? Yes.
    Actually comfortable to use? Nope, because it's so verbose than it makes reading/navigating/etc. inefficient.

    It's the same problem that visual languages like LabView have: it's friendly to beginners at the expense of actual usability for non-trivial projects.


  • Considered Harmful



  • @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    IMO, it is much better for teaching than any other programming language because you don't have to learn syntax, language keywords, naming rules, etc.

    Except that real languages do have specific syntax, keywords, rules, etc. If you're not teaching that, you're not teaching actual programming, only a toy version of it. It would be like teaching linguistics using only Lojban.


  • Considered Harmful

    @Zerosquare No, not really. You learn programming as much through learning C# as you do through learning Scratch. It's about learning to convert ideas into instructions and big instructions into smaller instructions.



  • Excuse me but there's already a programming language without loops and it's called BIT:

    Design Principles

    • Extend the ease of string processing in C to other, more basic, data types such as integers.
    • Extend the terseness of COBOL to more fundamental code constructs, such as numeric literals.

  • Discourse touched me in a no-no place

    @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    Since I don't speak Datalog I can't verify your claim that is_in_direction() exists as a language feature or a library method.

    It's neither. He was writing down its definition. (His value order seems weird to me, but that's probably a native-human-language thing.) That's what the other snippet seemed to be doing too.



  • @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    Since I don't speak Datalog I can't verify your claim that is_in_direction() exists as a language feature or a library method. Question was about common languages anyway such as Javascript, C#, C++, Python, PHP, etc.

    The logic programming languages are a wildly different beast from the C derivative syntax languages such as the ones you list here. You never specified any languages in your initial question, so picking a language archetype that is pretty much built for describing what your example was is a fairly good idea. I am a bit sad that I don't get to use logic languages in my professional capacity since they are kind of neat, and so different from what one normally uses.


  • Discourse touched me in a no-no place

    @Carnage said in Microsoft debuts Bosque – a yet another pointless programming language:

    I am a bit sad that I don't get to use logic languages in my professional capacity since they are kind of neat, and so different from what one normally uses.

    The closest most people usually get to a logic programming language is SQL. In theory, logic PLs should be great because you describe the problem and what you want to get out and have the system fill in the details. In practice, getting good performance out of them is hard (and SQL is one of the easiest to optimize in this way; Datalog is quite a lot harder).


  • BINNED

    @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    What he provided were two rows of such declarations in a language I am not familiar with, and he did it without explaining how is is_in_direction() actually implemented or for that matter whether it is implemented at all or just his own wishful thinking.

    I don't know Datalog, but assuming it's anything like Prolog, there's nothing to "implement" at all. You asked "how much code and structures would be needed to write this". Your example seems to only declare facts, and so does @Gąska's.

    Similar code in Python:

    is_in_direction = {("Black Gallery", "Lie Library") : "north",
                       ("Smoke-Damaged Chamber", "Lie Library") : "east"}
    

    or what I assume how JS works:

    is_in_direction = {"Black Gallery": {"Lie Library": "north"},
                       "Smoke-Damaged Chamber" : {"Lie Library" : "east"}}
    

  • Banned

    @levicki

    is_in_direction(x, y, dir1) <-
      is_in_direction(y, x, dir2),
      (
        dir1 = "north", dir2 = "south";
        dir1 = "south", dir2 = "north";
        dir1 = "west", dir2 = "east";
        dir1 = "east", dir2 = "west"
      ).
    

    Done.


  • BINNED

    @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    Also, that's the most ridiculous language I saw so far.

    Welcome to Ben L. YMBNH.


  • Considered Harmful

    @levicki sounds like a job for Prolog.


  • BINNED

    @pie_flavor :hanzo:'d by @Gąska ?!



  • @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    I agree with pie_flavor -- learning programming is not about learning language syntax, keywords and rules -- it's learning how to express your ideas through simple, comprehenisble instructions which someone (a person) or something (a machine) can follow.

    We have different definitions of what "learning programming" means, then. What you describe is the core, sure, but you also need to understand syntax, keyword and rules for it to be useful.

    Likewise, knowing musical theory is not enough to be a musician -- you also need to know how to actually play an actual instrument.



  • @levicki

    Also, that's the most ridiculous language I saw so far

    Can I interest you in Object Oriented Thue?


  • Considered Harmful

    @Zerosquare You could, in fact, be a musician without knowing how to play an actual instrument, if you don't consider Ableton an instrument. You're missing that song composing and song playing are entirely separate skill sets. If I didn't know how to play a lute, but I did know how to play a guitar, I could probably figure out how to play a lute pretty fast, far faster than if I was learning it for the first time. Syntax and keywords and rules are a one-day 'skill'; you can teach the entire language of LISP in under an hour.



  • @pie_flavor said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Zerosquare You could, in fact, be a musician without knowing how to play an actual instrument, if you don't consider Ableton an instrument.

    I consider it an instrument. It does not require manual dexterity, but mastering it is still a skill.

    You're missing that song composing and song playing are entirely separate skill sets.

    Sure, you don't have to be be a virtuoso player to be a composer, but few people who compose music use only their head and a piece of paper (or notation software).

    If I didn't know how to play a lute, but I did know how to play a guitar, I could probably figure out how to play a lute pretty fast, far faster than if I was learning it for the first time.

    I agree, but this is only because you already did the hard part by learning how to play the guitar in the first place. If you never had interacted with an actual instrument before, knowing music theory wouldn't help you much.

    @pie_flavor said in Microsoft debuts Bosque – a yet another pointless programming language:

    Syntax and keywords and rules are a one-day 'skill'; you can teach the entire language of LISP in under an hour.

    Nope. You say it's a one-day skill because you are already familiar with them. And writing good code in a new language takes more than a day, unless it's really close to another language you already know.

    University professors tend to discuss theory at length and gloss over practice, because to them it's "trivial to learn anyways". As a result, academic code quality sucks, and students are poorly prepared for the real world.



  • @Zerosquare I totally agree. Knowing the practical limitations and quirks of your instrument is critical. Otherwise you get people writing piano pieces that have 3 octave chords or impossibly quick jumps.

    I teach people to program as part of my job. And for someone starting out, syntax isn't easy. They don't see the significance of little things (like semicolons or spaces). There's a strong technical barrier to getting something working, and learning a toy language doesn't help with that.

    Not to mention that it teaches you very bad habits when you actually want to build something. If you're thinking in natural language, the quirks of the real language (which are certainly not natural language) will trip you up. Being super verbose, with hidden ambiguity and strong assumptions, such fake languages are basically pseudo code, but worse. Because they're a pain to actually write. Most importantly, they're anything but natural language. COBOL tried to do that, and failed. They have their own syntax quirks, their own oddities. They're as much natural language as Lobjan is. Except you can talk to people (if blubar counts 😜 ) in Lobjan.



  • @levicki sure, but it only defines 12 directions (cardinal & intercardinal, plus up/down and inside/outside). If you want to say something like “Alpha Centauri is towards the center of the galaxy of Sol”, which is (arguably) a valid natural-language sentence, you would first need to write “Towards the center of the galaxy is a direction. The opposite of towards the center of the galaxy is away from the center of the galaxy is away from the center of the galaxy”. You need to phrase it exactly like that, including the redundant definition of the opposite direction, and the awkward fragment “center of the galaxy of”, or the compiler won't know what you mean. There are several take-aways from this:

    • Not all natural language sentences are valid inform programs
    • Not all inform programs are valid natural language
    • You need to know Inform syntax in order to write Inform programs
    • Understanding the natural-language meaning of an Inform program is not the same as understanding how it will be executed

    DSLs like this are a gimmick: they allow you to write code that scans like prose, but they don't require it. And the fact the the code scans like prose can hinder one's ability to understand is as code. Compare it to a magic eye puzzle - the same source has two completely different meanings that you can focus on and to see the less familiar one, the brain must first unfocus from the more familiar one. Producing an interpretation of the code doesn't help anyone, what you need is a mental model of how that code will be executed.

    Take the first example posted in this thread:

    Index map with room-shape set to "square" and room-size set to 60 and room-name-size set to 9 and room-name-length set to 13 and route-thickness set to 15 and room-outline set to off and map-outline set to off and route-colour set to "White" and room-colour set to "White" and font set to "Trebuchet-MS-Regular" and EPS file.

    For starters, what the fuck does this even mean in natural language? “Index map with room-shape set to square”? It's fucking gibberish. But since it scans like natural language, natural-language instincts kick in, and people go with the closest interpretation they can find that seems correct. So we got a lot of posts showing how to create a data structure named map containing various named properties initialized to certain values, when that's not what that code does at all - it tells Inform to draw a map on the index page of the project, and how to draw it. Those posts also ignored “and EPS file”, because who knows what the fuck that means, or even whether it applies to the map or the index (braces, brackets, and parentheses are far better ways to show nesting than keywords are).


  • BINNED

    @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    Also, that's the most ridiculous language I saw so far.

    You truly are new here aren't you? It's Ben ... If it's not Go it's not a serious language, including lobjam


  • Banned

    @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    Depends on language. My day job is working with Datalog...

    Since I don't speak Datalog I can't verify your claim that is_in_direction() exists as a language feature or a library method. Question was about common languages anyway such as Javascript, C#, C++, Python, PHP, etc.

    As was already pointed out, it wasn't. At least it wasn't stated in what you wrote.

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    If the link was called...

    If you moused over it you would have seen it points to a file called source.txt

    Why would I even mouse over something that's probably of no interest to me based on link name? Your blaming the user for shitty UI is becoming ridiculous by now.

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    But if you read it like code - jumping randomly...

    It is not supposed to be jumping randomly -- it has a structure of a book with chapters and everything.

    And in which chapter is "everything that ever touches player inventory in any way"?

    You need to have a mindset where you define things in proper order as if you are explaining gradually more complex things to the reader when you write say a techincal book (or a story with an intricate plot).

    This won't help you with refactoring. Some types of changes simply have to be done with many different, very remote parts of code and no language will ever help you with that.

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    I'm 99% sure this language is in the same category as every other programming tool designed for non-programmer

    The difference is that it is really easily extensible.

    Most languages are extensible. But every single of them is only extensible in ways that the given language was designed to be extensible in. How easy would it be to add multiple player characters, each with their own inventory and current position, that can be freely switched between, GTA 5-style?

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    Isn't it very domain-specific - basically useless outside text adventures?

    From the website:

    Inform is used in the classroom by teachers at all levels from late elementary school through university. Playing and writing interactive fiction develops literacy and problem-solving skills and allows the development of historical simulations. See tutorials and reports from the field.

    So it really is useless outside text adventures.

    IMO, it is much better for teaching than any other programming language because you don't have to learn syntax, language keywords, naming rules, etc.

    Wrong. You do have to learn syntax and keywords. The syntax and keywords are more akin to English language, but you still have to learn it, and learn its limitations. You can't just say "on the table there is a lamp but this lamp has hidden container underneath that contains a password to the padlock to the safe in bedroom and the password is different on every playthrough".



  • As for the Bosque language: what's the advantage of being able to statically prove that your loopfolds always terminate if you can't provide the guarantee (or even expectation) that it will happen within a reasonable time frame, due to the design decision that all data structures must be immutable.

    Also, immutable data structures can be a giant pain in the ass to work with, and all the features intended to help with that are marked as TODO in the documentation.


  • Considered Harmful

    @Zerosquare said in Microsoft debuts Bosque – a yet another pointless programming language:

    @pie_flavor said in Microsoft debuts Bosque – a yet another pointless programming language:

    You're missing that song composing and song playing are entirely separate skill sets.

    Sure, you don't have to be be a virtuoso player to be a composer, but few people who compose music use only their head and a piece of paper (or notation software).

    That's fine, since the relationship we're talking about is in the other direction.

    If I didn't know how to play a lute, but I did know how to play a guitar, I could probably figure out how to play a lute pretty fast, far faster than if I was learning it for the first time.

    I agree, but this is only because you already did the hard part by learning how to play the guitar in the first place. If you never had interacted with an actual instrument before, knowing music theory wouldn't help you much.

    Yes, but that's because your comparison is between a mental skill and a physical skill. Theory obviously does not bestow upon you physical skill.

    @pie_flavor said in Microsoft debuts Bosque – a yet another pointless programming language:

    Syntax and keywords and rules are a one-day 'skill'; you can teach the entire language of LISP in under an hour.

    Nope. You say it's a one-day skill because you are already familiar with them. And writing good code in a new language takes more than a day, unless it's really close to another language you already know.

    University professors tend to discuss theory at length and gloss over practice, because to them it's "trivial to learn anyways". As a result, academic code quality sucks, and students are poorly prepared for the real world.

    Fully understanding a new language takes more than a day. The concepts of the language do not. Someone who is very familiar with Scratch could do passable VB after about an hour.



  • @pie_flavor said in Microsoft debuts Bosque – a yet another pointless programming language:

    Someone who is very familiar with Scratch could do passable VB after about an hour.

    Maybe? But "passable VB" is a pretty low bar, and Scratch is already closer to a "real language" than the one that @levicki is talking about.



  • @Zerosquare said in Microsoft debuts Bosque – a yet another pointless programming language:

    @pie_flavor said in Microsoft debuts Bosque – a yet another pointless programming language:

    Someone who is very familiar with Scratch could do passable VB after about an hour.

    Maybe? But "passable VB" is a pretty low bar, and Scratch is already closer to a "real language" than the one that @levicki is talking about.

    I'd dispute even passable. I'm self taught in c#, swift, python, and JS. When I switch projects or come back to a project after working on something else, it takes significant time to readapt to the quirks of the language. And my thinking is heavily colored by Python, as that was my first and primary language.

    What I'd expect from someone who learned mainly in toy languages is that they would write Scratch programs in whatever language they picked up next for a long time. Weeks or months. Habits are hard to break. And if the language is simple enough that you don't form habits, you can't learn anything useful. Because habits are everything.


  • Banned

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    And my thinking is heavily colored by Python, as that was my first and primary language.

    I'm lucky to have started with C++.



  • @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    And my thinking is heavily colored by Python, as that was my first and primary language.

    I'm lucky to have started with C++.

    Lucky? :princess-bride.meme:

    C++ seems like a very awful starting language. Tons of arcane boilerplate that must be learned by rote but is critical, picky syntax with subtle distinctions, manual memory management (yes, RAII is manual management), etc. Plus colon cancer.


  • BINNED

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    And my thinking is heavily colored by Python, as that was my first and primary language.

    I'm lucky to have started with C++.

    Lucky? :princess-bride.meme:

    C++ seems like a very awful starting language. Tons of arcane boilerplate that must be learned by rote but is critical, picky syntax with subtle distinctions,

    Truth

    manual memory management (yes, RAII is manual management)

    Wrong.

    , etc. Plus colon cancer.

    Irrelevant.



  • @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    C++ seems like a very awful starting language. Tons of arcane boilerplate that must be learned by rote but is critical, picky syntax with subtle distinctions, manual memory management (yes, RAII is manual management), etc. Plus colon cancer.

    I was also started off in C++. I can't say it was a good starting point, but you learn damned well to properly read code instead of just glancing over it and assuming that it does what it looks like, because in C++, at least the code I worked with, there is always a pile of gotchas and side effects. That is a good tick to have in every language, mistrust of the code doing what it looks like until you've actually verified that it does.


  • Banned

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    And my thinking is heavily colored by Python, as that was my first and primary language.

    I'm lucky to have started with C++.

    Lucky? :princess-bride.meme:

    C++ seems like a very awful starting language. Tons of arcane boilerplate that must be learned by rote but is critical, picky syntax with subtle distinctions, manual memory management (yes, RAII is manual management), etc. Plus colon cancer.

    But in the long run, it teaches you very valuable things. The barebones stdlib makes you very conscious of performance cost of various high-level operations. RAII and its pitfalls makes you good at resource management. Because all the tutorials are so low-level even though they don't need to be, I learned a whole lot about how computers work on a low level even though I've never worked directly with low level systems. C++ is awful language to start with, but a great language to have started with.


  • Banned

    @Carnage said in Microsoft debuts Bosque – a yet another pointless programming language:

    because in C++, at least the code I worked with, there is always a pile of gotchas and side effects.

    I still remember the day I learned std::bind works with shared pointers. It was one hell of a Valgrind session.



  • @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    And my thinking is heavily colored by Python, as that was my first and primary language.

    I'm lucky to have started with C++.

    Lucky? :princess-bride.meme:

    C++ seems like a very awful starting language. Tons of arcane boilerplate that must be learned by rote but is critical, picky syntax with subtle distinctions, manual memory management (yes, RAII is manual management), etc. Plus colon cancer.

    But in the long run, it teaches you very valuable things. The barebones stdlib makes you very conscious of performance cost of various high-level operations. RAII and its pitfalls makes you good at resource management. Because all the tutorials are so low-level even though they don't need to be, I learned a whole lot about how computers work on a low level even though I've never worked directly with low level systems. C++ is awful language to start with, but a great language to have started with.

    Sounds like an exercise in pure frustration to me. But if it works for you, that's great.

    I know the robotics teacher teaches middle-schoolers a form of C called robotc designed for VEX and LEGO robotics. But I think it is used in a graphical IDE at that level, and heavy use of pre-defined functions.

    Another teacher does C#/Unity for VR and Python/Raspberry Pi/Arduino. I've been doing HTML/CSS and will be taking over the introductory Python class next school year.


  • Banned

    @Benjamin-Hall mind you, I'm not recommending C++ to anyone starting out. All things considered, it's not worth it.


  • Resident Tankie ☭

    As a layman, what appear to me to be good readable languages are those that

    • have no "specific behaviour" (that is, you don't need to know the quirks of the language to understand what something does - which means, for instance, probably no overloading, because overloading is convenient but can fuck you in subtle ways, or the switch/case statement "cascading" through cases)
    • don't rely on specific symbology (= is ok, == or === isn't, which just like & | ~ ^ && || ! << >> -> :: etc. can be unclear to somebody who is a beginner, and a nuisance to somebody who juggles more than one language)
    • forbid or spell out clearly those operations that can be easy gotchas (bitwise operations, pointer arithmetic, etc.)
    • do not allow shorthand
    • encourage readable styles (with readable standard function libraries)
    • allow clear separation of information

    A language like Inform sort of reads like prose but is stuck in the uncanny valley and is unwieldy. You don't want information (which isn't really natural language) all clustered up in paragraphs. You want it clearly laid out. Lists are better. But lots of the readability depends not only on the base language itself, but also on libraries (standard libraries but also third-party libraries). Functions should have clear syntax that do not need looking through manuals, maybe with explicit assignment of parameters, eg.

    SetRoomDirection(room: "Living Room", relativeTo: "Kitchen", direction: "north") // or something similar
    

    But I realise this (and all the rest) makes for tedious coding.

    The underlying problem, I suspect (and I might be wrong) is that most people coding become so familiar with coding itself that they don't need (or feel they don't need) to make everything explicit. According to all the stuff I read and hear about "workflow", "it feels so nice to work with", etc. they might feel that hinders their coding because it takes too long to write and needs "formatting effort" that is alien to their "coding brain".

    A simple example:

    if (var1 && var2) { ... }
    

    vs

    if var1, var2 are both true then do: ... end if 
    

    (or maybe nonzero instead of true, and both is equivalent to all)

    The second is in my view clearer but do programmers agree?

    By the way, the vagaries of computer programming are such that some concepts cannot be clearly stated in natural language. Take for example:

    if ((var1 && var2) || var3) 
    // I always forget operator precedence
    // so I always state it explicitly :D
    

    How do you state this in natural language? And then there is the fact that why should programming be in English? How natural can it even be if it's not your native language? What if you're French? Or Italian? (Two cultures that traditionally struggle with English). The ideal language should also be one that can be translated... and developers hate this, since you hate Excel. I think the idea is perfectly sound at least in basic Excel and judging by the issues put forward I think that the problem is in the execution, because if documentation were comprehensive and translation tools up to par it would be much smoother. But still you have the problem of variable and function names, which make the problem unsolvable once you go beyond referencing cells.


  • Considered Harmful

    @admiral_p said in Microsoft debuts Bosque – a yet another pointless programming language:

    if ((var1 && var2) || var3)
    // I always forget operator precedence
    // so I always state it explicitly :D

    How do you state this in natural language?

    If both var1 and var2 are true or var3 is true



  • @levicki an NLP is not a natural language. Until you have people speaking it from birth, it's a conlang at best. A natural language is an organic thing by nature. INFORM7 is anything but. And more specifically, in context, it pretends to be English, but isn't. You have to learn its syntax, which is close enough to English to confuse, but not close enough to allow any fluent English speaker to write a conforming program without extra work.

    Trying to conflate the two just makes learning worse. I'm a teacher. I'm very familiar with what makes a good learning environment. And that ain't it.

    By the way, learning to play music doesn't start with music theory. That comes much later, and many good musicians never learn formal theory. You think like an academic, and that's not a complement. Been there, known those types. They're constantly trying to tell others how to teach, but don't have any real experience and ignore the real, proven experts in favor of some fancy to theory with no backing in the real world outside of tiny, unrepresentative studies under controlled conditions.


  • Resident Tankie ☭

    @pie_flavor not really, because "or" is usually understood as an exclusive or. It can both be exclusive and inclusive in natural language (you use "either A or B" to make exclusivity explicit) but the expectation for the listener is that, in "A or B", only one of the two will be true at once. In fact A OR B is often "translated" to something like "any or both of A and B" to make it clearer.


  • Resident Tankie ☭

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    @levicki an NLP is not a natural language. Until you have people speaking it from birth, it's a conlang at best. A natural language is an organic thing by nature. INFORM7 is anything but. And more specifically, in context, it pretends to be English, but isn't. You have to learn its syntax, which is close enough to English to confuse, but not close enough to allow any fluent English speaker to write a conforming program without extra work.

    I imagine that of course the assumption is that no "natural computer language" is all but an ersatz pseudolanguage. IF game writers actually like Inform 7 because it comes very naturally to them (I read a quote like "it took me four years to write my previous game in Inform 6, and four weeks to write this one in Inform 7"). If you compare Inform 6 to 7, the previous is your typical computer language more or less (according to Wikipedia, that is), while version 7 is the pseudonatural language he's talking about. I believe it only really works for somebody who's primarily a writer and wants to write games (with relatively simple mechanics, after all: the big effort is in the puzzles and writing itself, not that contemporary IF has many puzzles really) because it doesn't appear, at a quick glance, to lend itself to high information density code which does more than switch a couple of states here and there based on your actions. Its key strength seems to be in world building.

    Trying to conflate the two just makes learning worse. I'm a teacher. I'm very familiar with what makes a good learning environment. And that ain't it.

    I am a teacher too and I know from experience that a way to make things stick is to make them relatable. I think Inform could have its uses, maybe as a form of pseudocode that actually compiles.

    By the way, learning to play music doesn't start with music theory. That comes much later, and many good musicians never learn formal theory.

    By personal experience (I'm a musician myself), if you don't learn formal theory, the only good chance you have to become an accomplished musician (not necessarily a famous one, but a musician that can actually prove useful in a band) is to listen critically and actually link what you listen in others' music to what you should personally play. So in the end it's like inferring formal theory from observation.

    You think like an academic, and that's not a complement.

    And it's not a compliment either, I suppose.

    Been there, known those types. They're constantly trying to tell others how to teach, but don't have any real experience and ignore the real, proven experts in favor of some fancy to theory with no backing in the real world outside of tiny, unrepresentative studies under controlled conditions.

    That's a bit hand-wavey.



  • @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    That sentence is way too abstract even for an average human.

    Yeah, I don't like it either. “closer to the center of the galaxy than” is way better, but unfortunately the inform syntax is <location> is <direction> of <location>.

    You would first need to explain:

    That by "galaxy of Sol" you mean Milky Way

    Inform7 suffers from the design decision that strings don't require delimiters, which makes mistakes like the one you made here easy. If the required syntax was “Alpha Centauri” is “towards the center of the galaxy” of “Sol”, that would make it easier for a human to intuit how the compiler was going to interpret this rule.

    That Alpha Centauri is a star system with 2 stars (Alpha Centauri A and B) and a red dwarf (Proxima Centauri)

    Irrelevant.

    Concepts of right ascension and declination because you can't speak of directions in space without them

    I can and did.

    Concept (and location) of center of a barred spiral galaxy before you can say "towards it"

    Inform does let you defone “towards the center o the galaxy” as a direcion without explaining what it means. And to claim that the average human doesn't understand the concept of ‘center’ or know where the center of the galaxy is is absurd.

    I mean, I've heard that residents of LA called 911 to report a strange silvery cloud (the Milky Way) that appeared in the sky during a power outage after an earthquake, but that's a) probably an urban legend, and b) citizens of Los Angeles, not average humans. As Nick Cave puts it, “even the pale sky stars knew enough to stay well away from LA”.

    It shows with how much negative bias you are approaching the new thing when you strive to pick out something bad about it instead of focusing on the good parts.

    Hey, I would like natural language programming if it were good, but it isn't.

    Those posts also ignored “and EPS file”, because who knows what the fuck that means

    Did you try Encapsulated PostScript?

    Knowing the meaning of EPS doesn't help me to understand how “and EPS file” relates to the rest of the paragraph that it is appended to.


  • Discourse touched me in a no-no place

    @Buddy said in Microsoft debuts Bosque – a yet another pointless programming language:

    due to the design decision that all data structures must be immutable

    They're immutable at the language level. The compiler may have options to relax that, such as seeing that the only use of a particular value is immediately after to produce a related value based on it, which can be converted into an update. The good thing about immutable semantics is that it's actually much easier for the compiler to do that sort of trickery when it doesn't have to account for user code: it gets rid of all the problems with strange actions at a distance.

    I've no idea if their current implementation does this. 😉


  • Discourse touched me in a no-no place

    @pie_flavor said in Microsoft debuts Bosque – a yet another pointless programming language:

    Fully understanding a new language takes more than a day. The concepts of the language do not.

    Syntax is usually easy to understand, at least most of it. The space of predefined operations you can use with tha syntax… not so easy. (For example, most of C's syntax is fairly simple, but the implications of pointers with high levels of dereferencing are brain-bending. I'm sure you can find examples in other languages.) And then there's whatever is in the libraries available, which can be complex enough to take a year or more to master even for people with lots of general programming experience.



  • @dkf consider a video game where the game world can be an arbitrarily large data structure, which can be read or updated from many places in the code. Would ensuring that the game world is never memcpyed (assuming for the sake of this argument that this would result in a stutter or freeze noticable by the player) be any less hard than the analysis they are trying to avoid?

    Or, to come at this from another angle: why are mutable data structures available in Haskell?



  • @admiral_p said in Microsoft debuts Bosque – a yet another pointless programming language:

    The second is in my view clearer but do programmers agree?

    No. What if there are more than just two variables? What if there is a combination of variables that have to be true and ones that have to be false?

    There is a good reason the study of logic has symbols of its own. At the end of the day, programming languages are typically merely duplicating this.


  • Resident Tankie ☭

    @Deadfast and I acknowledge this right afterwards.



  • @admiral_p said in Microsoft debuts Bosque – a yet another pointless programming language:

    A simple example:

    if (var1 && var2) { ... }
    

    vs

    if var1, var2 are both true then do: ... end if 
    

    (or maybe nonzero instead of true, and both is equivalent to all)

    The second is in my view clearer but do programmers agree?

    I’d say we’re getting back to AppleScript territory again. Though it can’t do constructions like if var1, var2 are both true, you can certainly produce very readable code with it. (I say this as someone who has difficulty reading code: I tend to skip over it whenever a text includes a block of code and continue reading the actual text that comes after it — or the comments in the code, but hardly anything of the code itself.)

    I know it’s often said to be a write-only language, but most of its problems in this area result from trying to control applications with it. It does that well too (tell application "TextEdit" to make new document) but as soon as you want to do something slightly complicated, you’ll have to spend ages digging through documentation and just semi-blindly trying things to see if they work. Most of this is the fault of the applications themselves, because very few of them implement their particular abilities in similar ways to other applications.

    And then there is the fact that why should programming be in English? How natural can it even be if it's not your native language? What if you're French? Or Italian? (Two cultures that traditionally struggle with English). The ideal language should also be one that can be translated...

    Once more: AppleScript :) Though it’s English-only now, it was also localised in (IIRC) French, Japanese and maybe others in earlier versions of Mac OS.


  • Banned

    @levicki said in Microsoft debuts Bosque – a yet another pointless programming language:

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    Done.

    You forgot to define sw, se, nw, ne, up, down, in, out, and the combinations thereof. 🚎

    Left as an exercise to reader. Surely someone so well prepared for real world programming by playing with Inform7 has no problem filling out the rest.

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    There's a strong technical barrier to getting something working, and learning a toy language doesn't help with that.

    Inform7 is not a toy language.

    How come no one has ever created any non-game software with it? Hell, why are there no non-text-adventure games?

    @Benjamin-Hall said in Microsoft debuts Bosque – a yet another pointless programming language:

    Not to mention that it teaches you very bad habits when you actually want to build something. If you're thinking in natural language, the quirks of the real language (which are certainly not natural language) will trip you up.

    If you can't express yourself in a natural language you are a bad programmer.

    Expressing yourself in natural language doesn't help when computer doesn't understand it.

    Because they're a pain to actually write. Most importantly, they're anything but natural language

    Again, is Inform7 something you have experience with, or you are just making assumptions?

    Do you have experience with Inform7? In actual, medium-to-big projects? Say, a modest 20K lines of code? How was it?

    @Buddy said in Microsoft debuts Bosque – a yet another pointless programming language:

    If you want to say something like “Alpha Centauri is towards the center of the galaxy of Sol”...

    That sentence is way too abstract even for an average human. You would first need to explain:

    1. That by "galaxy of Sol" you mean Milky Way

    Ah, the simplicity and unambiguousness of natural language. It wasn't "Alpha Centauri is towards the center of (the galaxy of Sol)", it was "Alpha Centauri is (towards the center of the galaxy) of Sol".

    Actually, your example works well to show how much stuff programmers take for granted when they try to solve problems.

    You need to be more specific. Does assuming everyone knows Alpha Centauri is a star makes us worse programmers, or what?

    For starters, what the fuck does this even mean in natural language?

    Everyone seems to be grasping at that sentence which is actually not part of the program code, but just serves to set parameters for map drawing.

    It was your own goddamn example. You are to blame for bringing this up.

    It shows with how much negative bias you are approaching the new thing when you strive to pick out something bad about it instead of focusing on the good parts.

    Reminds me of someone... There was that one guy who claimed that a registry editing function changing value types is a proof that entire .Net ecosystem is worthless...

    @Gąska said in Microsoft debuts Bosque – a yet another pointless programming language:

    How easy would it be to add multiple player characters, each with their own inventory and current position, that can be freely switched between, GTA 5-style?

    If I remember correctly, you can change the player simply with:

    Now [character name] is the player.
    

    As for the location? Changing player to another character should change the location as well if that character is in a different location to begin with. Whether state will be preserved if the player moves and then transfers to yet another character I don't know. As for the inventory I am not sure but it shouldn't be too hard.

    Okay, bad example. I meant to asked about something that wasn't already implemented by the library authors and served on a silver platter to you. Hm, let me think of something... How hard would it be to integrate HOMM-style turn-based positional battle system? There are some units, and they're laid out on fields of hexagonal board, and they can move a certain amount in a turn and then attack if enemy is in range, and they take certain amount of HP depending on their strength. How hard would it be to implement something like that in Inform7?

    So it really is useless outside text adventures.

    If a Natural Language Programming teaching aid developed by people much smarter and more eloquent than you is useless what to say about your own work then?

    BTW, I didn't say it's useless. I said it's useless for anything outside text adventures. As evidenced by no one ever using it for anything outside text adventures. I wasn't talking about use as teaching material, I was talking strictly about use as a programming language.

    You can't just say "on the table there is a lamp but this lamp has hidden container underneath that contains a password to the padlock to the safe in bedroom and the password is different on every playthrough".

    You can't say that in any other programming language now can you?

    Exactly. Programming languages aren't natural languages, and natural languages aren't programming languages.

    Also, does "underneath" means "below the lamp" or "part of the bottom of the lamp"?

    And this is exactly why natural language is bad for programming: there are too many ways to interpret a single sentence.

    How is password contained? Does it evaporate when you open the container and you inhale it and magically know it?

    Funny thing - it would matter if you were explaining it to human, but it absolutely doesn't matter to Inform7. All Inform7 cares about is that there is password under the lamp, and you can take it, and having it is needed to open a padlock.


  • Java Dev

    @Gurth said in Microsoft debuts Bosque – a yet another pointless programming language:

    Once more: AppleScript :) Though it’s English-only now, it was also localised in (IIRC) French, Japanese and maybe others in earlier versions of Mac OS.

    Fun fact: An AppleScript written in english, with the english names for applications will fail if the system language is set to something other than english, as it looks for the english names of applications and options.


Log in to reply