Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I'm choosing C++.

Name: Anonymous 2016-02-01 12:48

So I went out looking for a new language. These days there are lots to choose from. There are the "new and hot" languages like Go, Rust, and Swift. Then there are the "corporate" languages like C# or Java. Finally, there are the "other" languages like Eiffel, Haskell, and Racket. Programming languages have a lot in common with religions. You can spend your life searching for the "one true" way, and either find enlightenment, or discover you were worshipping false idols.

To make a long story short, I looked into some of these languages, but eventually came back to C++. The reason was that C++11 is a much better language than old-school, C-with-classes C++. It's seems as if the language committee has been observing all the innovation going on in the world at large, and has done a great job of reacting to the times.

The new C++11 has copy and move semantics, iterators, range-based for loops, lambdas, the auto keyword, smart pointers, and a whole slew of new data structures and algorithms in the STL. These features are a boon to productivity, and I haven't even mentioned all the new stuff coming out in C++14 and C++17.

Just as an example, I managed to write 2500 lines of C++ using the more modern style of RAII and shared pointers, and there were zero memory leaks on the first try! The equivalent functionality in C would have probably been 2x the code, and an additional week studying Valgrind errors.

One thing that slowed me down was how to interface a C++ library with Python. C has cffi, and ctypes, which are both dirt-simple to use. The landscape for C++ extensions is a bit hairier. If you don't want to just write your own CPython extension, you can try using Boost Python, pybind11, or SWIG. So this adds a bit of cost, but it still seems do-able.

I want to congratulate the C++ standards committee for all the work they've been doing lately. And they're not even slowing down! The roadmap for C++17 looks like we'll get even more fantastic features, especially in the all-important areas of concurrency and parallelism.

So if you're like me and you've been ignoring C++ due to distrations from all kinds of shinier things such as Go, Rust, and Swift, I encourage you to take another look. Not only will you probably find new things to love about C++, but you might even find yourself being more productive due to seamless integration with all the C libraries you still depend on.

Name: Mentifex 2016-02-01 13:43

Does anybuddy here know Perl?

Mentifex is up against a problem in the following code from

http://ai.neocities.org/perlmind.txt for artificial intelligence:

sub AudInput() { # 2015apr25
$spt = $t; # 2016jan28: as in FileInput() module.
my $_ = " "; # 2016jan28: as in FileInput() module; PbEx p. 301
print "\nInput words, or Q for quit, then press RETURN: \n"; # 2016jan29
$msg = <STDIN>; # 2015may01: PERL by Example (2015), p. 50
chop $msg; # 2016jan29: Remove any newline last character; PBlBk p. 35.
print "Changing to uppercase. You entered: \n"; # 2016jan29: for left margin.
$msg = uc $msg; # 2016jan29: from Perl Black Book, p. 341.
print "\nHuman: $msg \n"; # 2016jan29: newline is now _outside_ $msg.
my $reversed = reverse $msg; # 2016jan29: PbyEx p. 125
if ($reversed =~ /[Q]/) { die "\aTERMINATE: Q for quit. \n"; } # 2016jan29
do { # PERL by Example (2015), p. 194: do/until Loops
$pho = chop($reversed); # 2016jan29 returns chopped character as $pho.
print "$pho"; # 2016jan29:
$t++; # 2016jan16: Increment time "t" here instead of AudMem()
if ( $pho =~ /[A-Z]/) { # 2016jan29: pattern binding operator
print " pho $pho is an alphabetic letter \n"; # 2016jan29
$len++; # 2016jan31: increment length as per MindForth
print " AudInput: increasing len(gth) to $len \n"; # 2016jan31
if ($len == 1) { $rv = $t } # 2016jan30: set recall-vector.
AudMem(); # 2016jan29: Calling memory-insertion subroutine
} else { # 2016jan30:
$pho = " "; # 2016jan30: Send blank space...
AudMem(); # 2016han30: ...as a message that word has ended
} # 2016jan30: End of else-clause.
# else { # 2016jan29:
} until $pho eq " "; # 2016jan30: Store whole word until $pho is empty.
$len = 0; # 2016jan31: when pho=0 length reverts to zero.
print "Robot: (AI does not yet think) \n"; # 2016jan29: as if Transcript

The problem is that the code stops processin input after one word in
"boys play games". Obviously the do-while loop above is stopping
when the input reaches the blank space of " " between "boys" and "play".
How does one get the code to repeat itself until the end of the
entire sentence, especially if a "\n" has been chopped off the input?

If anybotty wants to work on coding the P5 and P6AI "killer app,"
they may feel free to take the Mentifex Perl AI and "fork" it into
their own version of the best possible Perl Strong AI. TIA, ATM.

http://cyborg.blogspot.com/2016/01/pmpj0131.html

Name: Anonymous 2016-02-01 14:35

Menti needs to learn some BBCode.

Name: Anonymous 2016-02-01 18:17

Menti need to learn comments of today's date not substitute for version control.

Name: Anonymous 2016-02-01 18:39

things to love about C++

Thing is, every time the C++ standard is bumped with new and exciting ways to shoot yourself in the foot, it's like getting back with my abusive ex-gf.

It's all nice and sweet at first, you really feel you both've changed for the better and relationship can work this time. But pretty soon it becomes obvious we weren't meant for each other.

Name: Anonymous 2016-02-01 19:21

someone's been reading hackerjews

Name: Anonymous 2016-02-01 19:27

>>6
Nein, Reddit.

Name: Anonymous 2016-02-01 22:54

just use javascript

Name: Mentifex 2016-02-02 2:26

Name: Anonymous 2016-02-02 2:43

If it ain't Lisp, it's crap.

Name: Anonymous 2016-02-02 5:30

If it ain't crisp, it's Lap.

Name: Anonymous 2016-02-03 1:22

>>7
Even worse

Polecat kebabs

Name: Anonymous 2016-02-03 5:54

>>1
happy about no memory leaks on the fist try!

That's some serious Stockholm Syndrome on display.

Name: Anonymous 2016-02-03 6:42

>>13
Who are you quoting?

Name: Anonymous 2016-02-03 10:58

Chromosome 15 GET

Name: Anonymous 2016-02-03 11:21

>>14
He's quoting >>1

Name: Anonymous 2016-02-03 12:58

>>16
Who is quoting >>1?

Name: Anonymous 2016-02-03 13:57

>>17
>>13 is quoting >>1

Name: Anonymous 2016-02-03 13:59

>>14
being an anus

Name: Anonymous 2016-02-03 14:34

>>18
Thank you! Now I finally knoa who is quoating whom!!!

Name: Anonymous 2016-02-03 21:30

>>1-21,23-99
checkem

Name: Anonymous 2016-02-03 22:29

Hello mentifex, are you still here?

Name: Anonymous 2016-02-04 3:02

>>18
>>1-san never said that though.

Name: Mentifex 2016-02-04 4:34

>>22

Been coding Perl AI day after day after day.
Now about to upload mind0060.pl

http://ai.neocities.org/P6AI_man.html Perl AI User Manual

Name: Anonymous 2016-02-04 5:54

>>23
Look again my friend. I can assure you that >>1 is quoted correctly.

Name: Anonymous 2016-02-04 7:24

Arguing quotes, dubs, GETs, etc, all are a sign of extreme anti-satori, homosexuality, and niggerdry. There is more discussion about this shit than the actual thread topic. All of you fuck all the way off and get that cancer out of here.

Name: Anonymous 2016-02-07 19:42

>>25
Whoa, how did you do that?

Name: Anonymous 2016-02-09 6:36

Name: Anonymous 2016-02-09 9:02

>>27
CTRL + C
CTRL + F
CTRL + V
Enter

Name: Anonymous 2016-02-09 20:27

>>29
Is that an Emacs plugin?

Name: Anonymous 2016-02-09 21:23

>>28
Is it just me or is this awesome?

Name: Anonymous 2016-02-09 21:25

>>31
No, it's called a preprocessor.

Name: Anonymous 2016-02-10 16:35

KING OF DUBS

Name: Anonymous 2016-02-10 18:27

>>32
It's an awesome preprocessor.

Name: Anonymous 2016-02-10 19:36

>>34
It's another wheel reinvented under a different name. Prior art is 'art' for a reason.

Name: Anonymous 2016-02-11 0:11

>>35
It's not even another wheel. It's one of the Lisp preprocessors applied to C, instead of C's shitty one. And yes, it is art.

Name: Anonymous 2016-02-11 20:44

>>28
Bumping this awesomeness. This is C done right.

Name: Anonymous 2016-02-11 21:47

>>37
This comment read exactly like something I would find on a front page reddit/imgur post. Are you sure you're not from there? If you are (or even if you aren't), could you please consider going back there? Thank you.

Name: Anonymous 2016-02-12 2:05

>>38

something I would find on a front page reddit/imgur post
you need to go back

Name: Anonymous 2016-02-12 18:16

>>37,39
fuck off le shill

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List