Login / Register 0 items | $0.00 New @ KVR
Z1202
KVRian
 
946 posts since 11 Apr, 2002

Postby Z1202; Tue Apr 24, 2018 3:47 am Re: "Does C++ Have a Future?"

syntonica wrote:Rust uses a Let statement. Makes me feel like I'm back in 7th grade on the TRS-80. Level I.
I have been giving some thought to the problem of designing a language syntax which is 100% backwards compatible to the sources written for an earlier version of that language. The assignment statement seemed to me the biggest challenge.
User avatar
syntonica
KVRist
 
392 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Tue Apr 24, 2018 9:53 am Re: "Does C++ Have a Future?"

Z1202 wrote:
syntonica wrote:Rust uses a Let statement. Makes me feel like I'm back in 7th grade on the TRS-80. Level I.
I have been giving some thought to the problem of designing a language syntax which is 100% backwards compatible to the sources written for an earlier version of that language. The assignment statement seemed to me the biggest challenge.

Fortunately, with the Level II BASIC, the let statement was purely optional. If it couldn't be tokenized, then it was a variable. It was the best thing ever! (For 1977, of course...)
Z1202
KVRian
 
946 posts since 11 Apr, 2002

Postby Z1202; Tue Apr 24, 2018 1:08 pm Re: "Does C++ Have a Future?"

syntonica wrote:
Z1202 wrote:
syntonica wrote:Rust uses a Let statement. Makes me feel like I'm back in 7th grade on the TRS-80. Level I.
I have been giving some thought to the problem of designing a language syntax which is 100% backwards compatible to the sources written for an earlier version of that language. The assignment statement seemed to me the biggest challenge.

Fortunately, with the Level II BASIC, the let statement was purely optional. If it couldn't be tokenized, then it was a variable. It was the best thing ever! (For 1977, of course...)
So what if the newer version of the language introduces a keyword which coincides with one of your variables?
User avatar
syntonica
KVRist
 
392 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Tue Apr 24, 2018 1:19 pm Re: "Does C++ Have a Future?"

The Level I variables were limited to single letters, IIRC. Besides, how much code can you cram into 4k? :lol:

If you have to tell the compiler that this is a variable, prefixing const/var/mut etc. is preferable to me. It serves the purpose of let, but it's more informative to the human as well as the compiler.

Basically, I'm just not feelin' the cool retro Let vibe! 8)
mystran
KVRAF
 
4952 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Tue Apr 24, 2018 10:17 pm Re: "Does C++ Have a Future?"

syntonica wrote:Basically, I'm just not feelin' the cool retro Let vibe! 8)


The keyword "let" is found in most functional languages out there. It is usually syntactic sugar over anonymous function application and the purpose really is just to group the variable bindings and their values together (since it's way more readable than having the list of variables at the beginning and the list of values at the end, with a body in between; better compilers will usually produce the same code regardless).

Most likely your TRS-80 basic borrowed the keyword from Lisp.

ps. in Haskell you can also alternatively use "where" which is like "let" but allows you to put the bindings after the body (where are "let" puts them first), to further make the code more natural to read
Image <- plugins | forum
User avatar
syntonica
KVRist
 
392 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Tue Apr 24, 2018 11:09 pm Re: "Does C++ Have a Future?"

mystran wrote:Most likely your TRS-80 basic borrowed the keyword from Lisp.

ps. in Haskell you can also alternatively use "where" which is like "let" but allows you to put the bindings after the body (where are "let" puts them first), to further make the code more natural to read

You can't fool me. Haskell is just Lisp for people who wore out their parentheses keys!

I really don't care for syntactic sugar much. Extra typing and it rarely makes the code more readable to me. AppleScript/HyperScript is such a sugary mess, I can't use it at all.
Z1202
KVRian
 
946 posts since 11 Apr, 2002

Postby Z1202; Wed Apr 25, 2018 12:57 am Re: "Does C++ Have a Future?"

syntonica wrote:If you have to tell the compiler that this is a variable, prefixing const/var/mut etc. is preferable to me. It serves the purpose of let, but it's more informative to the human as well as the compiler.
Unfortunately simply declaring a variable whose name coincides with one of the language's keywords is a can of worms, if allowed. I haven't seen a good solution to that problem yet.
User avatar
BertKoor
KVRAF
 
10486 posts since 8 Mar, 2005, from Utrecht, Holland

Postby BertKoor; Wed Apr 25, 2018 3:52 am Re: "Does C++ Have a Future?"

mystran wrote:Most likely your TRS-80 basic borrowed the keyword from Lisp.
Sorry, I don't buy that. Because BASIC is a very imperative language and has not much in common at all with functional languages like LISP.

And so some research confirms this:
http://dobegin.com/let-keyword/
https://softwareengineering.stackexchan ... rst-appear

BASIC as a language (including the later made optional keyword LET) predates the introduction of the LET macro (syntactical sugar, so not even a common keyword) in LISP by nearly a decade.
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is back online!!
mystran
KVRAF
 
4952 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Wed Apr 25, 2018 7:32 am Re: "Does C++ Have a Future?"

BertKoor wrote:
mystran wrote:Most likely your TRS-80 basic borrowed the keyword from Lisp.
Sorry, I don't buy that. Because BASIC is a very imperative language and has not much in common at all with functional languages like LISP.
[...]
BASIC as a language (including the later made optional keyword LET) predates the introduction of the LET macro (syntactical sugar, so not even a common keyword) in LISP by nearly a decade.


I stand corrected then, although I still highly doubt Rust borrowed it from BASIC directly.
Image <- plugins | forum
Triplefox
KVRist
 
39 posts since 24 Nov, 2009

Postby Triplefox; Mon May 21, 2018 12:11 pm Re: "Does C++ Have a Future?"

Bumping this thread because I was actually doing some technology shopping the other day for VST dev. I ended up picking up dplug and got the monosynth example running in about 20 minutes - I have some familiarity with D already. In the past I've only done real-time DSP via audio callbacks in e.g. JS or Actionscript, so the nuts and bolts of VST are all new, but this gives me a smoother path than C++, which I find to be "professional" in the bad way. As in, you'd have to pay me to work with it. And that's not even really a statement about the language itself, in its current state. It's the build system and all the legacy stuff. That's stuff that gets cleared up when working with pretty much anything other than the C/C++ family.

Most language features OTOH, you don't need most of them most of the time. The constructs that are already in every language are the ones that are best to use in anger, and the things you absolutely must have can always be built yourself with the help of some source code generation. But the biggest productivity gains, I find, come from two categories: better errors/debugging/automated checks, and flexibility with respect to dynamic runtime behavior. If the language doesn't have reflection support or automatic memory management, for example, eventually I do end up with a program that has to implement those things on its own, poorly. Conversely, if I start by writing in e.g. Python, I can get off to a great start flinging around weird cobbled-together data structures in exploratory fashion. But the program may eventually get big enough that it doesn't always run every codepath, and then I start wanting to use static typechecking(which, fortunately, is a thing in Python nowadays). So I prefer to have something that supports a gradient of options to properly reflect the maturity of the code.

The core stuff of DSP dev has a relatively straightforward need, though: parse some algebraic expressions, turn them into fast inner loop code. Those bits are always small but dense in terms of lines of code, and they don't directly involve complex resource management problems. You can end up with a lot of resources to track if you expand the scope of the program enough, of course. But it's basically in keeping with the rule: as a codebase gets larger, the "hotspots" get relatively smaller. Most code is run once or never, most of the time.
User avatar
aciddose
KVRAF
 
11914 posts since 7 Dec, 2004

Postby aciddose; Mon May 21, 2018 2:58 pm Re: "Does C++ Have a Future?"

You're overlooking 99% of the code of a plug-in.

The DSP "inner-loop" is only 1%.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
Previous

Moderator: Moderators (Main)

Return to DSP and Plug-in Development