Should I learn Racket or Haskell

Forum: PC programming What programming language learn? (C, Phyton, Lisp, Swift, Smalltalk?)





Hello, didn't know how to design the thread title ... I want to learn a programming language, but I'm not sure which one. The subject has been covered here many times, and I've read through a few other threads as well. First some information: - I'm 50 now and will definitely not work with it professionally. So it stays in the hobby area. But I want to learn something new and interesting and not necessarily drift with the mainstream. - My later goal is simple programs and that I can read / control a few IO ports on the board (and the USB port). - I only use Linux. - The language should be easy to learn. Whereby no general statement can be made and it also depends on what suits you. - I have medium experience with PHP. But somehow you write your fingers sore. In any case, there is too much superfluous syntax for me and in the end I was enjoying it less and less. I'm not interested in writing web applications either, I just wanted to mention PHP to describe what suits me and what doesn't. - Even if C is one of the leading programming languages, I can't really get used to it. I've dealt with it a couple of times and it never gave rise to joy. And when it comes to Java, I only understand the train station. I'm really sick of this dot syntax. Perhaps that is also the reason why I never learned to program before. I've just never liked these languages. Since I would also like to program microprocessors, C would almost be the only option again, but I really don't want to make my choice dependent on that. - Phyton is totally in fashion right now, should be easy to learn and would have the advantage of a large community. I don't really like the code either. So I came across Lisp, more precisely Common Lisp. If I look at the example code, even without prior knowledge, parts of it appear logical and legible to me and I have the feeling that I could enjoy it. But can you still do anything with it today? Other languages ​​might be Smalltalk and Swift. I've looked at too few code examples for this, but I'm still completely impartial.



C # over .NET Core 2.0 Ruby Python Dietmar wrote:> I only use Linux Can all three languages ​​Dietmar wrote:> My later goal is simple programs and that I can read / control a few> IO ports on the board (and the USB -Port) If you use a virtual serial interface as a USB bridge, no problem. You don't want to write "native" USB (without good libs underneath) Dietmar wrote:> But I want to learn something new and> interesting and not necessarily let myself drift with the mainstream>. I find the wrong approach. The languages ​​become mainstream if they are easy to write / learn or if there is no (meaningful) alternative.



If you say Lisp, small talk is only logical ;-) however, you won't be happy with either of them in the uC environment (it's a pity, I still consider Lisp to be one of the clearest and most efficient languages ​​of all) I think it depends how much experience you already have in the uC environment and what your plans are. If you are also a "beginner" in the uC environment, I recommend Arduino: Hardware very clear and open (important!), And the language is C ++, but "reduced to the max", so without all the fuss. I play in a similar league in terms of age ;-) I had previous electronics and programming knowledge, but found a very smooth but exciting introduction to Arduino (even if I have "outgrown" it by now). My favorite in the uC area is, however, after as before C, without ++



Dietmar wrote:> I don't like the code> really either. The worm has to taste good to the fish and not to the angler, and the code to the computer. Why do you really want to do a hobby that, after your post, you actually dislike everything? Unconscious masochism? Your penchant for particularly exotic programming languages ​​would also speak for this. I cannot recommend any of the languages ​​for pleasure-based programming, strictly speaking none of the hundreds of programming languages ​​at all, and that was never the intention when defining them. I'm a lot older than you and I've learned a few new languages ​​lately, but this is real work and doesn't even go in an afternoon. By the way, I wouldn't use PHP for direct hardware I / O, but it's just my personal opinion. In principle you can do anything in any language, Turing has already proven that his Turing machine can execute every conceivable program. George



Take a look at Nim - first the tutorial parts 1 and 2. (I'm assuming you can speak a little English, otherwise you won't have much choice anyway.) Unfortunately, a job with Nim is still almost hopeless, but that's what you expect Not. But of course there are a number of nice new languages ​​- Nim is probably the most universally applicable, in principle also for microcontrollers. For Apple fans, Swift might be the first choice, and for Android, ugly old Java. Or now Kotlin. Rust is interesting, of course, but like C ++, it's more for advanced users, and it's not that much fun. And if you don't like the indentations, then maybe Crystal. The other languages ​​such as Julia, Elixir, Red, Scala tend to be more specific. Go is not very innovative and is already losing some of its popularity. Haskell would of course be a nice challenge if you dare to do it. In my opinion, the days of Ruby and Python are rather over, even if Python is still very popular. With JavaScript you could of course make nice web gamers if you like that, but the language itself is not so nice. Well, that's a broad field ...



Overcome yourself - and learn C, stay with Linux, take a look at the SystemD-free unixoid OS such as the BSDs. In Linux, it's best to do everything with the shell and thus in the terminal. Use vi or vim as an editor. If you don't have big projects in mind, then avoid everything that has to do with OOP and code procedurally. Later you can add assembler and Forth to C.



Chris wrote:> C # over .NET Core 2.0 I would strongly advise against that ... Vril wrote:> Forth You're not serious, are you? (Yes, I programmed Forth) Stefan wrote:> But Nim can be used most universally,> in principle also for microcontrollers. How exactly do you mean "in principle"? Maybe only I read out "uC", but a simple and functioning toolchain (especially under Linux) would not be entirely unimportant ...



And if you are still unsure, have a look at the Rosetta code: http://rosettacode.org/wiki/Category:Programming_Tasks And yes, you should be able to do C because you will understand what the computer is actually doing. You don't have to use it later.



http://openbook.rheinwerk-verlag.de/c_von_a_bis_z/ Since C is explained to you in great detail, I recommend it. I wouldn't necessarily start assembler anymore, but C is a very good foundation, without which you write blah code, it doesn't do a lot of work for you, but many examples are in C and if you understand C then you also understand Python. Also, C is even closer to uC. Work through the link above and then look at the examples at e.g. http://www.ulrichradig.de/home/index.php/avr to play with it a bit.



Vril wrote:> Use the vi or vim as an editor. Exactly. And the best way to program is in Malbenue. : DI think python should be good for you. This was developed as a beginner's language and it makes a lot very easy.



If you asked this question in a software forum that doesn't focus on embedded programming, no one would answer "C" ... C just has so many pitfalls and even simple things like string processing are unnecessarily complicated. So if microcontroller programming is not compulsory and you want to program "normally" on Linux, e.g. on a Raspberry PI, you would prefer to use one of the many high-level languages. These are more intuitive and simply less frustration. The big advantage of mainstream languages ​​(Java, Python, Go, ...) is that there are very good tools and that you can find an answer to every problem. With niche languages ​​you are left alone faster. The beauty of code is really not an argument, however. Dot notation is the absolute standard; in C ++ you can always use -> if you really want to, but what is the point? Consistent logical syntax is much more important, but C and C ++ really don't have that.



Michael R. wrote:> How exactly do you mean "in principle"? 1. The uC should already have at least 64k Ram. 2. Parts of the standard library are not allowed to be used because they use the GC. 3. You have to define the registers and hardware addresses. Well, there is a certain restriction at the moment. Look for "Nim embedded" there you can already find some projects. For the group "stupid, lazy and voracious" who want to have everything pre-chewed, this is probably nothing. That with the standard library will probably change soon, which should then largely do without GC.



Dr. Sommer wrote:> If you ask this question in a software forum that has no focus> on embedded programming, no one would answer "C" ... C has> just so many pitfalls and even simple things like> string processing are unnecessarily complicated. This is nonsense, of course - entire operating systems were written in C ... and they have been around for 30 years and more - in contrast to the half-life of trash, called Blue_Screen_something from Redmond. And as for the mainstream languages ​​mentioned here, such as Java and Co.: Badly programmed software that is also extremely slow: Java guaranteed!



Vril wrote:> This is nonsense of course - entire operating systems were written in C> ... What exactly is nonsense? Just because the OS is written in it doesn't mean you have to write the application in it too. Vril wrote:> Badly programmed software, which is also extremely slow:> Java guaranteed! Yes, because Java is so simple that anyone can do it, and so many beginners work with it and produce bad code. If these bad algorithms were transferred to C, they would not be a bit better. Of course, you can also produce very good software with Java. And for beginner programs, performance isn't that important anyway. Writing unstable software in C is much easier, thanks to buffer overflows, lack of type safety, etc. I know this from the E-engineering students - they are tormented with C and have to do funny type-and-syntax guesswork, ala "what means void (* A [4]) (int * [], char **, int (*) (void *, signed *, unsigned *), char); "? This ensures that you are guaranteed not to feel like programming anymore. It starts with explaining the three meanings of the asterisk, or what a void * is. All just unnecessary frustration and brain dislocation.



There are such pretty colorful learning programming books for elementary school children to color with cute animals. I think this would be right for you. Or just google Brainfuck.



If you stay on the PC and it is halfway (> = 1 GHz), then you can pretty much beat anything with Perl. Wendelsberg

Post # 5303969 was deleted by a moderator.


Wendelsberg wrote:> If you stay on the PC and it is halfway (> = 1 GHz), then> You can pretty much kill anything with Perl. However, you can't really beat foolish talkers with Perl.



Michael R. wrote:> which would be doubtful ;-) All sorts of large websites are written there (on the server side!), Such as Twitter, Google (partially), Amazon ... On PC software you could use LibreOffice or Minecraft (yes I know early versions of this were slow), call umlet, plantuml.



annoyed wrote in post # 5303969:> Michael R. wrote: >> Dr. Sommer wrote: >>> Of course you can also >>> produce very good software with Java >>>> which would be doubtful ;-) >> with which you would no longer have to doubt your stupidity. Forgot Smiley? This bird is dead. Dead dead dead. A kind of wester. https://www.youtube.com/watch?v=UE0Jk0KqKRc


Since you are not driven to program by anyone and can choose yourself, I suggest "Pure-Basic" https://www.purebasic.com/german/introduction_linux.php The programs written with it can be compiled for different operating systems and cannot be dragged a mess of .Net and something else for stuff afterwards. The program has one German Help file and there is a forum with reasonable people. (I came from Algol and Pascal and the C-like stuff makes me feel sick and nauseous.) MfG Paul georg wrote:> I am considerably older than you and have recently learned some new> languages, but this is real work and doesn't even work like that> in an afternoon. Anyone who wants to be able to do everything can end up doing nothing right. The human capacity is not unlimited.