Shop OBEX P1 Docs P2 Docs Learn Events
Prop II: Speculation & Details... Will it do what you want??? - Page 12 — Parallax Forums

Prop II: Speculation & Details... Will it do what you want???

11012141516

Comments

  • RaymanRayman Posts: 14,020
    edited 2011-05-10 11:50
    I think the Prop 2 is being designed for direct USB interface. I noticed once that the values for the internal pull-up resistors were exactly what you need for USB signalling...
  • localrogerlocalroger Posts: 3,451
    edited 2011-05-10 15:14
    Leon wrote: »
    Who wants to use BASIC - Beginner's All-purpose Symbolic Instruction Code? I've always used assembler and C, and wouldn't touch BASIC with a bargepole!

    Considering that VB6 was the most popular language in the history of computing when Microsoft stupidly deprecated it, the answer to your question would appear to be "just about everybody."
  • LeonLeon Posts: 7,620
    edited 2011-05-10 15:31
    I've never seen BASIC used for software development in any of the companies I've worked for.
  • Andrey DemenevAndrey Demenev Posts: 377
    edited 2011-05-10 15:36
    I know at least one company that has sold thousands of devices with firmware written in Basic
  • LeonLeon Posts: 7,620
    edited 2011-05-10 15:50
    There are far more companies that use C!
  • jmgjmg Posts: 15,149
    edited 2011-05-10 16:00
    Leon wrote: »
    I've never seen BASIC used for software development in any of the companies I've worked for.

    Really ?

    I've used Basic & Pascal as scripts to generate ASM Files, CPLD files, and Parameter tables & test/derive PLL ranges.

    Those have all been shipped in embedded systems, so whilst we did not create HEX files using Basic, we certainly do meet the
    "use BASIC for software development" test ;)
  • LeonLeon Posts: 7,620
    edited 2011-05-10 16:24
    Scripting languages have always been used where I've worked. I don't think that BASIC was even available on any of the workstations at BAe and Racal, and it was never used on any of the PCs also used for development. It might have been available on the PCs where I used to work but I never saw anyone using it. I might have it on this laptop I'm using, but I've never bothered to check.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-10 16:35
    Leon:
    Wow, to not have it on that laptop would mean not to have any resent Windows :) . For this I truly do applaud you.
  • Martin_HMartin_H Posts: 4,051
    edited 2011-05-10 16:41
    Except for Microsoft and their VisualBasic obsession, BASIC is generally viewed as a beginner's language. I would agree with that as most BASIC dialects do not lend themselves to large scale projects or code re-use. This doesn't make BASIC bad, I learned to program with it and I like PBasic but I get paid to program in C family languages.
  • LeonLeon Posts: 7,620
    edited 2011-05-10 16:47
    Leon:
    Wow, to not have it on that laptop would mean not to have any resent Windows :) . For this I truly do applaud you.

    I'm running Win 7 x64!

    It might have BASIC on it, I've never checked.
  • RaymanRayman Posts: 14,020
    edited 2011-05-10 17:10
    If you have Microsoft Office, you have Visual Basic (for applications). It's built into almost all the Office apps. It's actually very useful sometimes...
  • LeonLeon Posts: 7,620
    edited 2011-05-10 17:27
    I use Open Office, it's free!
  • RaymanRayman Posts: 14,020
    edited 2011-05-10 17:37
    There's a reason it's free...

    Actually, I'm a fan of Open Office even though I've only tried it a couple times...
    MS Office is extremely expensive. I think it's worth it, but I'm glad there's a free alternative out there...
  • LeonLeon Posts: 7,620
    edited 2011-05-10 18:24
    It's not as polished as MS Office, but it's got nearly the same functionality. I quite like the Access database, though. I did a big project with it once. I'd probably use MySQL these days.
  • Jim FouchJim Fouch Posts: 395
    edited 2011-05-10 20:14
    It's interesting how a thread about the Prop II has turned to the topic about if VB is a serious language or not. One of the problems I see with VB getting a bad rap is because they kept the BASIC name. VB .Net is about as far removed from the original concept what BASIC was designed for.

    I see the C# vs VB debate come up all the time. It about the same as the Java vs .Net wars too.

    I think it’s much more important to find what you’re productive in. Years ago writing something in C++ would mean it was WAY faster then something written in GW Basic for example. Now days, it really makes no difference when you’re talking about the .Net framework. All the languages boil down to the same IL and CLR.

    In my experience companies care more about if you can solve their PROBLEMS and not so much in the language you chose. I’ve managed to make a very good living selling my services working in BASIC. Mostly because the modern BASIC (VB. Net) allows me to wrap my solution around the customer’s problem instead of twisting problem around the limits of a lower level language like C/C++.

    I have written several larger applications in the industrial automation and control, health care, business management, marketing fields, etc. All solutions were written in this very BASIC language. When you can provide a solution for a customer that exceeds their requirements, under budget and ahead of their timeline, that’s what really counts. Not that is was written in a particular language.

    I once did a custom database solution for a customer and charged them ~$30K. In the first year they realized $1.3M in recovered fees. They used that solution for 6 more years. Do you think they cared one bit that I wrote the application in VB 4/5 and it had a simple MS Access backend? No, they laughed all the way to the bank with their $8M+ in savings.

    Still think it’s just for beginners???
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-10 20:16
    Martin_H wrote:
    I would agree with that as most BASIC dialects do not lend themselves to large scale projects or code re-use.
    I would say this is only true if you are in the time before about 1991. Most BASIC dialects of this day and age are very powerful and modular languages, and NOT suited to beginners.
  • Heater.Heater. Posts: 21,230
    edited 2011-05-10 21:05
    As I said before.
    In the old days there were various dialects of BASIC. A very simple language for beginners in programming, normally interpreted or compiled to tokens and interpreted. Generally BASIC programs were not portable between dialects or machines. Really only suitable for small projects, for sure no good for writing operating systems and other hard tasks in computing.

    Then there were the "real" programming languages FORTRAN, Algol, later Pascal, C/C++ etc. These were designed. They were compiled for speed. They had block structure, typed variables, functions, procedures objects even. They could help with large projects an systems programming (OS stec).

    Time goes by and BASIC evolved into what we have today getting block structure, objects, functions all the bells and whistles needed for large interesting projects. Still no use for serious work like OS building or making a relational database with any speed.

    At the same time the "real" languages, evolved into, for example ADA the ultimate design of a "real" language with every feature you would ever need for large projects and safe code. So verbose and complicated that nobody wanted to use it.

    Or the real languages devolved into Java, C#, etc. Lo they are non-portable (don't argue, there are a thousand more targets for C++ than C# or Java combined). They run on VMs making them bloated and slow for systems work or embedded systems.

    Real languages and BASIC converged into the same form from different directions. Quite a common thing in the real world of animal evolution.

    Thank God C is still in there making all those others possible:)
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-10 21:26
    Heater:
    I mostly agree with you. Yes C is quite nice in that the compilers actually tend to support the standard (although most have incompatible extensions [such as 101 ways to do inline ASM]), and verious languages have there strong points.


    Now here is were I disagree:
    Most modern BASIC compilers (VB does NOT COUNT) produce well optimized binaries and are quite capable of being used for OS development, for OSes that run at as good of a speed as with C/C++ (there is a project to port the Linux kernel from C to BASIC using FreeBASIC, not to mention other FreeBASIC dialect 100% BASIC kernels). Also as for relational databases at good speed modern BASIC is no less capable of this than any other language, it is just a matter of the developer producing good algorithms and implementing them well (as with any language).

    Unfortunately BASIC suffers from its past. In the past there were the line numbered interpreters, then came the byte code structured compilers (QB/VB), these were and are to slow to be very useful for much (and lack many features that BASIC now has almost universally), then beginning in the late 90s various groups began the creation of the modern BASIC compilers, these produce fast optimized binary code, provide all the features of the common programming languages, and are highly modular (and in some cases even OO), not to mention; they are less fragmented in there syntax, and structure. In short modern BASIC is a very usable language, though two things hold it back: 1) its past, 2) VB (old school BASIC from the past still produced).
  • Sal AmmoniacSal Ammoniac Posts: 213
    edited 2011-05-10 21:30
    BASIC: Proof that although you can put lipstick on a pig, it's still a pig.
  • RossHRossH Posts: 5,359
    edited 2011-05-10 21:33
    Heater. wrote: »
    At the same time the "real" languages, evolved into, for example ADA the ultimate design of a "real" language with every feature you would ever need for large projects and safe code. So verbose and complicated that nobody wanted to use it.
    Respectfully disagree. Ada was/is a beautiful language - and is significantly smaller, simpler, better designed, better supported, had better tools, and is probably still faster than any of the "#" languages (A#, C#, F#, J# etc, etc, etc).

    Yes, Ada looked "big" at the time - but that was before the era of .NET! The Ada language, plus all of its libraries and runtime support infrastructure was described in one document - the ARM (Ada Reference Manual). And it now looks tiny compared to either C++ or C#/.NET. Just look at any "Dummies Guide to C#/.NET" type book!

    Every programmer I knew who learned Ada and used it in anger ended up loving it - partly because debugging was almost unheard of. Once your program compiled, it generally ran - and usually ran correctly first time - and also usually ran on any platform! On many platforms no operating system was required. On those platforms where Ada ran under an operating system, you generally need to know only the one command required to load your program. Massive safety-critical real-time systems were built successfully with it.

    Unfortunately, companies like M$ loathed it. Guess why? And guess who won?
    Heater. wrote: »
    Thank God C is still in there making all those others possible:)
    Yup.

    EDIT: Oh, and it's "Ada" not "ADA". It isn't an acronym - the language is named after Ada Lovelace (no relation to Linda!).
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-10 21:42
    Thank you RossH:
    Ada Lovelace, a researcher that worked with Charles Babage on the Analytical Engine (early mechanical computer design, never constructed in there life), widely considered to be the first modern computer Programmer as she designed the concept of the loop in computer programming.

    Now we have a well thought out language named in her honer and we (generally) do not even use it.
  • Heater.Heater. Posts: 21,230
    edited 2011-05-10 22:11
    Ah, I love a good programming language mud slinging, err I mean, debate. We are seriously off topic now.

    DavidSaunders,
    Most modern BASIC compilers (VB does NOT COUNT) produce well optimized binaries

    Yes then there are those BASICS. Thing is if BASIC has evolved in that way as well, block structure, types, functions, objects etc. Then what was the point? Why not have just gone with the plethora of other "real" languages that were/are around.
    there is a project to port the Linux kernel from C to BASIC using FreeBASIC

    Astounding, I think we need a link to that project.

    RossH,

    Ada is a "big" language. In terms of it's syntax, semantics and features. I have the impression that writing an Ada compiler is a lot harder than writing a C compiler say. Which probably leads to the observation that Ada compilers tended to produce a lot more executable binary than other languages. Don't get me wrong I like it.
    Every programmer I knew who learned Ada and used it in anger ended up loving it

    That makes me smile, trying to program in Ada does make you angry, the compiler whines and complains about every little indiscretion like a demented school master:)
    Once your program compiled, it generally ran

    Yes it does an excellent job of picking up stupid programmer mistakes an twisting your arm into writing correct code. That phenomena that "if you can actually get your code to compile it's a thousand times more likely to run as intended than with say C" is amazing.

    Sadly it seems a lot of the worlds programmers never got over their frustrating "school master" experience and went to C instead. Which leads to that phenomena we have seen here in recent days, a desperate clamouring for debuggers and hardware debug features in the Prop II.

    Sorry yes "Ada" not "ADA". Apologies to Ms Lovelace.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-10 23:49
    heater wrote:
    Why not have just gone with the plethora of other "real" languages that were/are around.
    Beings the roots of BASIC good question. Though now that it is to this point, for some the syntax of BASIC is simpler to work with than that of C.

    Now I do not see any advantage in using BASIC over a good Pascal, as both are pretty simple. Pascal also has the advantage of having separate assignment and is equal to operators, BASIC use the same symbol for both.

    From a different point of view, think to the first C compiler you wrote, as well as the first Pascal compiler, The Pascal compiler was a lot simpler as a beginning software engineer correct? Well BASIC is even easier to parse and you loose nothing, because it is easier to parse it is also easier to optimize the output of the compiler.
  • Heater.Heater. Posts: 21,230
    edited 2011-05-11 00:22
    David,
    think to the first C compiler you wrote,

    Ahh...You got me there. You see I have only ever written one compiler in my life. It was based on the TINY compiler as outlined by Jack Crenshaw in his "Let's build a compiler series". Although with my own preferences in syntax. I managed to get a bit beyond Jack's series and create a code generator that emitted assembler for for x86. Later on I added another code generator for LMM PASM on the Prop. Both were very simple source language and totally lacking in optimization.

    To me achieving that was a magical thing. I had been struggling the thought "How does a compiler work and how would one ever set about writing one?" for many years. None of the books on compiler construction a came across helped. Then Jack shone a little light into that particular black box.

    Anyway, it seems to me that simple syntax and easy parsing is not necessarily related to good optimization. As Jack shows you can in single pass parse a language with a suitably arranged syntax and generate the code at the same time. Easy. Trouble is that is not the way to get any good optimization.

    As far as I can tell to optimize you need parse the source into an intermediate representation of the code. In an abstract syntax tree or whatever. That can then be tweaked and transformed for optimization and then you generate the machine code from the result. So there is that intermediate disconnect between the input source and the output code. So who cares what the input syntax was? the optimization happens on the intermediate representation.

    Of course I may be grossly misunderstanding the situation:) That's what comes of studying Physics instead of Computer Science.
  • LeonLeon Posts: 7,620
    edited 2011-05-11 02:52
    Ada is very widely used! It survives as VHDL, which was based on Ada, and is one of the two main languages used for hardware design with programmable logic. Vast numbers of people are using VHDL. The other language, Verilog, is based on C. Although I like C, I can't get on with Verilog and prefer VHDL.

    I can't see the relevance of the BASICs used for developing applications on PCs, the versions used for embedded systems are completely different.

    VB is probably written in C++, which might tell you something. I remember many years ago when MS announced that they were switching to VB for all their software development, which was met with disbelief. They quickly abandoned the idea and reverted to C.
  • Heater.Heater. Posts: 21,230
    edited 2011-05-11 03:00
    Leon,
    I can't see the relevance of the BASICs used for developing applications on PCs, the versions used for embedded systems are completely different.

    Did you mean it that way. I would have made that exact same statement with out the 't

    :)
  • LeonLeon Posts: 7,620
    edited 2011-05-11 03:05
    I should have said that I can't see the relevance of those BASICs like VB to this discussion about languages used for embedded development.
  • Heater.Heater. Posts: 21,230
    edited 2011-05-11 03:57
    Me neither.
  • RaymanRayman Posts: 14,020
    edited 2011-05-11 05:59
    Just for fun, I'll say that SPIN is very similar to BASIC, in my view. And, my VisualSpin has an appearance noticed to be similar to the old VBDOS.
    So, with Prop2, it may be plausible to develop an IDE similar to VisualBasic that generates GUI interfaces similar to VB...
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-11 07:23
    Heater:
    The point is that if you are not spending all your time trying to get it to parse you have a chance to work on optimization. And you would be surprised how much optimization can take place at the top level parser. Some would argue that a well written highly optimizing compiler can be written doing all the optimization during Parsing, and peephole optimization on the assembly, thus giving you a three pass compiler that produces well optimized code.

    Leon:
    I have said it once twice and now three times:
    VB is a left over from the earlier style structured BASIC, and does not represent modern structured BASIC. For a BASIC that does, see FreeBASIC.
Sign In or Register to comment.