ejolson
Posts: 3800
Joined: Tue Mar 18, 2014 11:47 am

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Thu Jul 18, 2019 5:29 pm

jalih wrote:
Thu Jul 18, 2019 4:46 pm
ejolson wrote:
Wed Jul 17, 2019 6:35 pm
Has anyone tested the approach described in this post of creating a vector of letter counts rather than sorting?
I tried that approach with 8th to generate map keys instead of sorting word alphabets. It ran about the same speed as my original version. I got a little help from the 8th forums and version below is currently the fastest version for 8th:

Code: Select all

m:new var, anamap
a:new var, anakeys

: s:sort \ s -- s
  a:new swap ' a:push s:each!
  ' n:cmp a:sort
  ( swap s:+ ) "" a:reduce ;

: process-words \ word --
  /^[a-z]+$/ r:match if
    r:str nip dup >r
    s:sort
    anamap @
    over
    m:exists? if
      over m:@ r> a:push 2drop
    else
      swap a:new r> a:push m:!
    then
  then drop ;

: read-and-check-words  \ fname --
  f:slurp ' process-words s:eachline ;

: len>=  \ key --
  anakeys @ swap a:push drop ;

: fetch-ana-list \ key array --
  a:len 2 n:cmp
  1 n:+
  nip
  [ ' drop , ' len>= , ' len>= ]
  swap
  caseof ;

: key-val-cmp          \ key1 key2
  anamap @ swap m:@    \ key1 anamap key2val
  0 a:@ nip            \ key1 anamap val2
  swap rot             \ val2 anamap key1
  m:@ nip              \ val2 key1val
  0 a:@ nip            \ val2 val1
  swap                 \ val1 val2
  s:cmp ;

: sort-keys-by-first-word
  anakeys @ ' key-val-cmp a:sort drop ;

: list-words \ value --
  " " a:join . cr ;
 
: app:main
  0 args "/usr/share/dict/british-english-insane" ?:
  read-and-check-words
  anamap @ ' fetch-ana-list m:each drop
  sort-keys-by-first-word
  anamap @ anakeys @ m:@@ nip ' list-words a:each! drop
  anakeys @ a:len nip "\nAnagrams: %d\n" s:strfmt .
  bye ;
  
Execution time using "/usr/share/dict/british-english-insane" word list:

Code: Select all

real	0m10,689s
user	0m9,992s
sys	0m0,684s
That's nicely faster than the Perl code and in many ways more readable.

I wonder whether C++ with sort templates would generate less greenhouse gases than the C programs. Although compiling might destroy a rainforest or two, the loss would quickly be compensated by a billion people using the resulting binary to improve their bananagrams.

Along different lines, do you think it might be possible to find anagrams in the insane British dictionary using interpreted Basic? Since no compiling would be needed, no rainforests would be harmed.

Heater
Posts: 13872
Joined: Tue Jul 17, 2012 3:02 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Thu Jul 18, 2019 6:11 pm

ejolson,
...do you think it might be possible to find anagrams in the insane British dictionary using interpreted Basic? Since no compiling would be needed, no rainforests would be harmed.
Yes, the rain forests would be safe from compilation. And I'm sure interpreted BASICs could get the job done eventually. But I think of it like this:

Imagine a world where all the factories, boats, trains and cars were still powered by steam engines burning lot's of lovely black coal. Houses, shops, factories, streets and roads were still lit by gas. Homes and all were heated by coal burning fires.

All of that was perhaps acceptable when we knew no better, the industrialized population was very small and the total population of the planet was much less and living in poverty.

That is what it would be like if everyone used BASIC today.

People miss BASIC like we miss the majesty of steam engines and I miss sitting by the heat and glow of a coal hearth. But it's just not acceptable at scale.

:)
Memory in C++ is a leaky abstraction .

ejolson
Posts: 3800
Joined: Tue Mar 18, 2014 11:47 am

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Thu Jul 18, 2019 6:38 pm

Heater wrote:
Tue Jul 16, 2019 3:59 am
Yes, I will... I have watched online videos of lectures of under graduate courses in introductory CS from MIT and Berkeley. The oldest, and best, by Prof. Brian Harvey from Berkeley over 10 years ago.

These course covered introductory CS material including learning a programming language and moving on to data structures (lists, trees, etc) and various algorithms and algorithmic analysis etc. Over the years the language used has changed, even if the conceptual stuff remained the same. Brian Harvey originally used Scheme the last one I saw used a version of Scratch would you believe!

I was amazed to find that in the year they used Java the poor students were having a really hard time even programming simple things. Half way through the course they were still lecturing on how to program in Java. The actual CS material was way behind. Lost in the noise of all that language complexity.

Contrast to the Scheme version of the course where the language was pretty much done with after the first week and they moved on to to the interesting CS stuff immediately.

So yes, I blame Java.
I've been thinking about this anecdote since last year and have a different theory: Due to the demise of the golden age of personal computing as well as the steam engine, the students changed in a significant way over the observed time period.

Scheme was used for the earlier course because the instructor didn't want to bore students who were already expert Basic, Pascal and C programmers with something they already knew. Later such an assumption didn't hold, so the course changed to include a significant amount of introductory programming material. Not surprisingly, the poorly prepared students struggled anyway.

This highlights why reintroducing programming alongside reading, writing and arithmetic is important in primary and secondary school and the original problem the Raspberry Pi was designed to address.

Musketeer
Posts: 152
Joined: Fri Feb 12, 2016 1:23 pm
Location: CZ

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Fri Jul 19, 2019 11:07 am

Java - write once, debug everywhere!
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!

ag123
Posts: 18
Joined: Sun Dec 18, 2016 7:54 am

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Fri Jul 19, 2019 4:12 pm

c++ is good it is catching up with java
with things like boost
https://www.boost.org/
and poco
https://pocoproject.org/
you nearly has an SDK like encyclopedic library

as for python, below python is c & c++, and that can further hook that up to superpower cuda or opencl driven super computers
and that super computer can be the top tier national grid supercomputers
python normally for the 'front' layer so that you don't need to do all that hard work of the icing in c/c++
i.e. write code compile, problem debug with a debugger, edit compile again and run again.
with python it is just edit and run
this is especially so if you are meddling in 200 dimension tensors if 2D is x and y, 3D is x, y and z then 200 dimensions you would run out of alphabets and tensors
but numpy and
https://numpy.org/
the entire anaconda suite is made just to do that scientific computing (actually more than that)
https://www.anaconda.com/distribution/
then you add googles tensorflow
https://www.tensorflow.org/
and with sufficient enlightenment you may reach the nirvana of deep reinforcement convolution neural network machine learning
the machines trained with sufficient data comes alive and works like a *living thing* ! - the danger of the dark side
https://www.youtube.com/watch?v=-TTziY7EmUA

oh by the way would anyone explore the *dark side* and make an all powerful Raspberry pi 4 robot with machine vision i.e. cameras programmed with tensorflow and python and it figure how to walk all around your city? lol
it would scare the hell out of the city folks as if they has seen a ghost
this is no longer fiction as the learning can be simulated on a fast computer with a high powered gpu crunching away with petaflops of desktop computing power, then the trained simulated model loaded on a Rpi 4 robot and the whole thing comes alive

perl is a little different and it is invented initially as a 'sysadmin' language
it is ideal if you need to dice with text

c is pretty ok, until one day you visit a code that has a set of pointers to pointers to pointers to pointers to pointers and that they are void * pointers so that they can point to any structure or functions. c++ java & all that 'object oriented-ness' is supposed to try to suppress this demon of a cryptic web of pointers, i'm not too sure how far all that object oriented-ness has achieved that, but probably it helps one write tidier codes if one wants to
Last edited by ag123 on Fri Jul 19, 2019 4:45 pm, edited 4 times in total.

ejolson
Posts: 3800
Joined: Tue Mar 18, 2014 11:47 am

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Fri Jul 19, 2019 4:35 pm

Heater wrote:
Thu Jul 18, 2019 6:11 pm
People miss BASIC like we miss the majesty of steam engines and I miss sitting by the heat and glow of a coal hearth. But it's just not acceptable at scale.
Basic was never meant to be majestic but rather as simple as possible while at the same time being all purpose. Note that in addition to being easy to learn, it was important for Basic to be easy to implement. This is because the original Dartmouth computer-literacy project specified that the undergraduate students also write the Basic compilers.

For majesty one should look to C++ and Java. After the digital apocalypse when all programs are written using deep-learning convolutional neural networks, the C++ and Java programming languages will replace the museum exhibits of ornate silver and porcelain tea sets which are presently used to demonstrate the rich excess of generations past.

Fortunately, we still have C, which retains much of the simplicity and efficiency of the original. If only it were as easy to learn as Python.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Fri Jul 19, 2019 10:08 pm

ejolson wrote:For majesty one should look to C++ and Java. After the digital apocalypse when all programs are written using deep-learning convolutional neural networks, the C++ and Java programming languages will replace the museum exhibits of ornate silver and porcelain tea sets which are presently used to demonstrate the rich excess of generations past.
For majesty there is no likes of BCPL, B, and C. The two you list are more of a worms nest (spegetti ball) than the worse of the stripped down MS-8KB BASIC program (even back then BASIC was a lot better than MS gave us, having parameterized subroutines with local veriables in the late 1970's [see Dartmouth BASIC (I think version 5 if I remember correctly)]).

Or see a good structured BASIC implementation, either MS-AmigaBASIC (many compilers available), BBC BASIC, or (pushing it here) Sinclair SuperBASIC.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Fri Jul 19, 2019 10:16 pm

For saving electricity we could do a better balancing act than current compilers. Selective optimization, based on what is going to make the most difference. And have a means for the programmer to specify where extra optimizations should be used.

For the rest of the code just do some simple optimizations (simple register tracking for variables, constant expression elimination, case statement profiling for jump table, and inlining of very small functions).

In other words, normally do the level of optimization that can be done in even the simplest compilers, and reduce the compile run time. Then allow for extra optimizations to be applied only to portions of the code that it makes good since to so do with, as specified by the programmer.

This would make any language compiler better, save power in compiling (how many things does everyone still need to compile to use), as well as still saving power in execution.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

jahboater
Posts: 4828
Joined: Wed Feb 04, 2015 6:38 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Fri Jul 19, 2019 11:51 pm

DavidS wrote:
Fri Jul 19, 2019 10:16 pm
Then allow for extra optimizations to be applied only to portions of the code that it makes good since to so do with, as specified by the programmer.
GCC can do that now. The programmer may specify that a function is either "hot" or "cold".
The branch prediction stuff for cold is interesting.
cold

The cold attribute on functions is used to inform the compiler that the function is unlikely to be executed. The function is optimized for size rather than speed and on many targets it is placed into a special subsection of the text section so all cold functions appear close together, improving code locality of non-cold parts of program. The paths leading to calls of cold functions within code are marked as unlikely by the branch prediction mechanism. It is thus useful to mark functions used to handle unlikely conditions, such as perror, as cold to improve optimization of hot functions that do call marked functions in rare occasions.

When profile feedback is available, via -fprofile-use, cold functions are automatically detected and this attribute is ignored.
hot

The hot attribute on a function is used to inform the compiler that the function is a hot spot of the compiled program. The function is optimized more aggressively and on many targets it is placed into a special subsection of the text section so all hot functions appear close together, improving locality.

When profile feedback is available, via -fprofile-use, hot functions are automatically detected and this attribute is ignored.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 2:18 am

jahboater wrote:
Fri Jul 19, 2019 11:51 pm
DavidS wrote:
Fri Jul 19, 2019 10:16 pm
Then allow for extra optimizations to be applied only to portions of the code that it makes good since to so do with, as specified by the programmer.
GCC can do that now. The programmer may specify that a function is either "hot" or "cold".
The branch prediction stuff for cold is interesting.
Not quite what I am speaking of. I mean that the compiler runs a simple much faster parser for most of the code, only performing extra optimizations as specified (and only the extra optimizations specified), using a different parser if needed.

I know that some optimizations can only be done after the parser is done with it, hence the 'if needed' clause.
cold

The cold attribute on functions is used to inform the compiler that the function is unlikely to be executed. The function is optimized for size rather than speed and on many targets it is placed into a special subsection of the text section so all cold functions appear close together, improving code locality of non-cold parts of program. The paths leading to calls of cold functions within code are marked as unlikely by the branch prediction mechanism. It is thus useful to mark functions used to handle unlikely conditions, such as perror, as cold to improve optimization of hot functions that do call marked functions in rare occasions.

When profile feedback is available, via -fprofile-use, cold functions are automatically detected and this attribute is ignored.
hot

The hot attribute on a function is used to inform the compiler that the function is a hot spot of the compiled program. The function is optimized more aggressively and on many targets it is placed into a special subsection of the text section so all hot functions appear close together, improving locality.

When profile feedback is available, via -fprofile-use, hot functions are automatically detected and this attribute is ignored.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
Paeryn
Posts: 2738
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 3:48 am

DavidS wrote:
Sat Jul 20, 2019 2:18 am
jahboater wrote:
Fri Jul 19, 2019 11:51 pm
DavidS wrote:
Fri Jul 19, 2019 10:16 pm
Then allow for extra optimizations to be applied only to portions of the code that it makes good since to so do with, as specified by the programmer.
GCC can do that now. The programmer may specify that a function is either "hot" or "cold".
The branch prediction stuff for cold is interesting.
Not quite what I am speaking of. I mean that the compiler runs a simple much faster parser for most of the code, only performing extra optimisations as specified (and only the extra optimizations specified), using a different parser if needed.

I know that some optimizations can only be done after the parser is done with it, hence the 'if needed' clause.
I don't know how other compilers work but for gcc the C front-end parsing phase is already simple and quick, it doesn't do any optimisations, those are mainly the domain of the middle-end, are language & processor independent and happen after all parsing has been done. The back-end then does final low-level optimisations before generating the processor-specific code.

Switching between multiple parsers mid-compile sounds like a good way to inadvertently end up with parsers that interpret the same code differently.
She who travels light — forgot something.

ag123
Posts: 18
Joined: Sun Dec 18, 2016 7:54 am

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 6:58 am

ejolson wrote:
Fri Jul 19, 2019 4:35 pm
Basic was never meant to be majestic but rather as simple as possible while at the same time being all purpose. Note that in addition to being easy to learn, it was important for Basic to be easy to implement. This is because the original Dartmouth computer-literacy project specified that the undergraduate students also write the Basic compilers.

For majesty one should look to C++ and Java. After the digital apocalypse when all programs are written using deep-learning convolutional neural networks, the C++ and Java programming languages will replace the museum exhibits of ornate silver and porcelain tea sets which are presently used to demonstrate the rich excess of generations past.

Fortunately, we still have C, which retains much of the simplicity and efficiency of the original. If only it were as easy to learn as Python.
i like your snap :)
i've seen *real* codes e.g. open sourced etc that has c pointers to pointers (to pointers) and void * pointers funneled all over the place. it would take one enormous effort to figure out how pieces fit together. one can think of highly 'flexible' *plug-in* style modules and environments where the system is designed for one to plug one thing to another in a daisy chain or more elaborate setups, and that it handles data structures from anything to anything (any elaborate structures) (file systems?). the simplest pointers to pointers to pointers and void * pointers is a cascading set of call backs to call backs to callbacks that pass any structures to pointers to structures. Imagine a parser that can parse any possible language in the world and translate any language to any language. or in other cases like the high level declaration that an svg file, pdf document, cad document, msword document is a collection of arbitrary objects, fonts, text, etc, that become 'as generic as possible' and yet the codes need to deal with every different object at run time

i think to an extent java and c++ did not succeed in taming that real world affairs. i.e. it is really *natural*
anything that you want to be generic linked to generic linked to generic ended up with one doing cast to java.lang.object
voiding all that 'object oriented-ness' that's supposed to tame the pointers to pointers to pointers and void * pointers
(java & c++ has some sort of run time type identification though, all that *reflection (java)* and *RTTI (c++)* technology)
the fact that such projects exist shows where things are headed
https://www.rttr.org/

but unfortunately the digital apocalypse using deep-learning convolutional neural networks is going to make things worst
how are you *ever* going to be able to debug a deep-learning convolutional neural network?
the whole nest possibly millions to billions of machine learned parameters are just arbitrary synapses in the artificial neurons
if it develop a bias i doubt any humanly efforts are going to be able to fix it
Last edited by ag123 on Sat Jul 20, 2019 8:28 am, edited 1 time in total.

User avatar
DougieLawson
Posts: 36541
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 7:50 am

Musketeer wrote:
Fri Jul 19, 2019 11:07 am
Java - write once, debug everywhere!
The opposite of that is: Java, that's C++ without the ammunition and the smoking weapon.

You don't get the same level of opportunity to create pointer errors with Java because there's a single, clean, clearly defined interface for passing data between methods. With C++ you can turn everything into a blue screen of death with pointer abuse.

Now, lets guess what the language of choice was for the Windows kernel.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ag123
Posts: 18
Joined: Sun Dec 18, 2016 7:54 am

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 7:59 am

DougieLawson wrote:
Sat Jul 20, 2019 7:50 am
Musketeer wrote:
Fri Jul 19, 2019 11:07 am
Java - write once, debug everywhere!
The opposite of that is: Java, that's C++ without the ammunition and the smoking weapon.

You don't get the same level of opportunity to create pointer errors with Java because there's a single, clean, clearly defined interface for passing data between methods. With C++ you can turn everything into a blue screen of death with pointer abuse.

Now, lets guess what the language of choice was for the Windows kernel.
oh did ms somehow removed blue screens?
i'd guess these days with virtual memory, mmu, memory protection etc it simply crashed without warning
it burst just like a soap bubble - poof
lol

i'd guess the good o' parts of the windows kernel is still C
but lookout for this
https://docs.microsoft.com/en-us/window ... df--driver
it is increasingly c++, and there are obvious reasons as like when java & c++ started - an attempt to limit the complexity of the *real world*

User avatar
Michiel O.
Posts: 178
Joined: Mon Dec 12, 2016 12:06 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 9:40 am

ag123 wrote: all that 'object oriented-ness' is supposed to try to suppress this demon of a cryptic web of pointers, i'm not too sure how far all that object oriented-ness has achieved that
If you'd ask Brian Will, not so much:

Object-Oriented Programming is Bad

...and a few examples where OO went horribly wrong:

Object-Oriented Programming is Embarrassing: 4 Short Examples

For some ideas how some programming concepts (modularisation, encapsulation, polymorphism, abstractions) can be used correctly:

Object-Oriented Programming is Good... or not?
"You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes

Heater
Posts: 13872
Joined: Tue Jul 17, 2012 3:02 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 9:50 am

DougieLawson,
The opposite of that is: Java, that's C++ without the ammunition and the smoking weapon.
Take away the power and there is less chance people will hurt themselves or others.

I'm not sure I agree with the notion that Java is a kind of C++. Or perhaps we can say it is, like a plastic toy gun from Toys'R'Us sort of looks like a real one.
You don't get the same level of opportunity to create pointer errors with Java because there's a single, clean, clearly defined interface for passing data between methods. With C++ you can turn everything into a blue screen of death with pointer abuse.
Ugh? There are no pointers in the Java language.

It does have references, symbols that refer to objects. An entirely different thing. You can still cause program failure by using them incorrectly.
Now, lets guess what the language of choice was for the Windows kernel.
Probably because it's not actually possible to write an operating system kernel in Java. For that you need a real gun not a toy.

Or perhaps because Java did not exit when the Windows kernel was created. Windows: 1993, Java: 1996.

By the way, have you actually seen the source code of the Windows kernel? I suspect it's actually C. Or was when it was created. C++ was not a thing until 1998.

Am I showing a disdain for Java here? Absolutely. Java is the only major language we have that: Offers nothing new conceptually, was not created to solve any particular problem anyone had, has no reason to exist at all... Don't get me started on C#
Memory in C++ is a leaky abstraction .

jahboater
Posts: 4828
Joined: Wed Feb 04, 2015 6:38 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 9:58 am

Heater wrote:
Sat Jul 20, 2019 9:50 am
By the way, have you actually seen the source code of the Windows kernel? I suspect it's actually C. Or was when it was created. C++ was not a thing until 1998.
Yes. I believe Windows is 98% C, with a little C++ and a tiny amount of C#

Heater
Posts: 13872
Joined: Tue Jul 17, 2012 3:02 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 10:19 am

jahboater,

Wow, amazing, how did that happen?
Memory in C++ is a leaky abstraction .

jahboater
Posts: 4828
Joined: Wed Feb 04, 2015 6:38 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 11:01 am

Heater wrote:
Sat Jul 20, 2019 10:19 am
Wow, amazing, how did that happen?
How did what happen?

If you are talking about relative dates, then things like OS's and surrounding software evolve over time.

Heater
Posts: 13872
Joined: Tue Jul 17, 2012 3:02 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 3:29 pm

jahboater,
How did what happen?
Sorry, I took your "yes" above to be an affirmative answer to my question "...have you actually seen the source code of the Windows kernel?"

I presume now that it was not.
Memory in C++ is a leaky abstraction .

Musketeer
Posts: 152
Joined: Fri Feb 12, 2016 1:23 pm
Location: CZ

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 5:00 pm

You know, why is C such a rude language?

Because it has no class!
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!

jahboater
Posts: 4828
Joined: Wed Feb 04, 2015 6:38 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 5:03 pm

Heater wrote:
Sat Jul 20, 2019 3:29 pm
Sorry, I took your "yes" above to be an affirmative answer to my question "...have you actually seen the source code of the Windows kernel?"

I presume now that it was not.
Correct, sorry.

Used to have the UNIX source code back in the "version 7" days (educational license, Amdahl UTS), and the IBM VM/SP (and CMS) mainframe source code (in very well written assembler).

Heater
Posts: 13872
Joined: Tue Jul 17, 2012 3:02 pm

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 5:20 pm

Musketeer,

Boom, boom!

Motorola 6809 assembler is more risqué with it's SEX op code.

We should not even mention BASIC in polite company, what with all it's PEEKing and POKEing.

Those C++ classes can be pretty rude, what with letting their friends see their private parts.
Memory in C++ is a leaky abstraction .

Musketeer
Posts: 152
Joined: Fri Feb 12, 2016 1:23 pm
Location: CZ

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 5:27 pm

I am open minded! O:-) I got A6502 with just 52 instructions in Atari !

Not speaking about TOUCH lib (https://github.com/admarschoonen/TouchLib) !

Stuff like this no AI will ever enjoy...
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!

User avatar
bensimmo
Posts: 4187
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Sat Jul 20, 2019 6:25 pm

jahboater wrote:
Sat Jul 20, 2019 9:58 am
Heater wrote:
Sat Jul 20, 2019 9:50 am
By the way, have you actually seen the source code of the Windows kernel? I suspect it's actually C. Or was when it was created. C++ was not a thing until 1998.
Yes. I believe Windows is 98% C, with a little C++ and a tiny amount of C#
But they don't really like it
Rust in peace: Memory bugs in C and C++ code cause security issues so Microsoft is considering alternatives once again
https://www.theregister.co.uk/2019/07/1 ... _security/

From
https://msrc-blog.microsoft.com/2019/07 ... cure-code/

Return to “C/C++”