tag:blogger.com,1999:blog-4222267598459829544.comments2024-03-15T00:28:25.403-07:00Ben Lynn's Online GarbageBen Lynnhttp://www.blogger.com/profile/09117417699962852340noreply@blogger.comBlogger126125tag:blogger.com,1999:blog-4222267598459829544.post-37733366153434040132019-08-18T22:59:07.408-07:002019-08-18T22:59:07.408-07:00Thanks! I skimmed it just now.
I'm happy to r...Thanks! I skimmed it just now.<br /><br />I'm happy to report my demo (https://crypto.stanford.edu/~blynn/haskell/pwd.html) seems to handle S = S S | "a"; correctly.Ben Lynnhttps://www.blogger.com/profile/09117417699962852340noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-82400741919691714002019-08-18T16:10:51.081-07:002019-08-18T16:10:51.081-07:00Have you seen this? https://www.cs.ru.nl/bachelors...Have you seen this? https://www.cs.ru.nl/bachelors-theses/2018/Timo_Maarse___4416295___Parsing_with_derivatives_in_Haskell.pdf<br /><br />"The authors also provide a Haskell implementation [5], but it has the following issues: 1. It cannot handle, for example, the following grammar: A → AA | a"<br />Jon Harrophttps://www.blogger.com/profile/11059316496121100950noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-34623985077048660352019-03-19T08:27:47.059-07:002019-03-19T08:27:47.059-07:00I admire what you have done here. I like the part ...I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. <a href="https://charactercount.org/" rel="nofollow">https://charactercount.org</a><br />Adams Younghttps://www.blogger.com/profile/01167048066610540926noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-17596602903192884082017-06-13T12:48:27.172-07:002017-06-13T12:48:27.172-07:00Go does not leave signed overflow undefined: integ...Go does not leave signed overflow undefined: integers are defined to be <a href="https://golang.org/ref/spec#Numeric_types" rel="nofollow">represented using two's complement</a>, and the language further <a href="https://golang.org/ref/spec#Arithmetic_operators" rel="nofollow">specifies</a> that "for signed integers, the operations +, -, *, and << may legally overflow and the resulting value exists and is deterministically defined by the signed integer representation, the operation, and its operands."<br /><br />Two's complement vs. one's complement was historically the reason for C not specifying signed overflow semantics, but the reason current compilers (for two's complement platforms) do not just nail this down are separate. Some have to do with loop dependence analysis, but the biggest single contributor is simply that C didn't manage the transition to 64-bit gracefully.<br /><br />Specifically, for backwards compatibility reasons, C "int" on 64-bit platforms is generally 32-bit, not 64-bit. But this is a big source of low-level code generation issues. Consider something like an array access "arr[i + 1]" where i is a 32-bit integer, in some loop that already accesses "arr[i]" elsewhere. Compilers would like to compute the address of "arr[i]" once, and then use a relative addressing mode to access "arr[i + 1]" (or just eliminate i altogether and turn it into pointer arithmetic). This is equivalent if the integer type in question is pointer-sized, but not if it isn't.<br /><br />The primary application of the "signed overflow is undefined" rule in current C/C++ compilers (for 64-bit platforms) turns out to be silently promoting 32-bit ints to 64-bit ints when they are used as loop counters or feed into addressing operations. (See e.g. <a href="http://lists.llvm.org/pipermail/llvm-dev/2011-November/045735.html" rel="nofollow">this</a> write-up.)<br /><br />The choice of endianness boils down to all current major web host platforms (PC Windows/Linux, Mac OS X, iOS, Android) using Little Endian. Specifying WASM to use Big Endian would introduce extra friction and conversions in every interface to native code on all these targets.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-44855831367278415862015-10-19T02:59:37.002-07:002015-10-19T02:59:37.002-07:00I'm in the same boat as you. Love C++ with a p...I'm in the same boat as you. Love C++ with a passion, but it seems there's not enough "tooling" to build scalable applications. I've since seen that a single, integrated (monolithic?) framework is not necessary. For example, I'm currently working on a project using FastCGI with a completely JSON-based web API, making the HTML rendering pointless. The database is abstracted, keeping the business logic completely separate from SQL (or NoSQL) - you can run unit tests without the database "attached" in a single line of code. Also, having the entire application in memory and persistent between requests removes all the concerns of object-relational mapping.<br /><br />After having programmed with PHP for the last 10 years, my return to C++ is a return to clarity, allowing me to focus on business problems rather than databases/user-interfaces/infrastructure/etc. FastCGI and C++ is the bomb. Period. But for non-C++ people, it's probably more like the don't-mention-it-at-an-airport type of bomb.Michaelhttps://www.blogger.com/profile/04719381358438096123noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-78539758029577302132015-09-17T03:32:27.547-07:002015-09-17T03:32:27.547-07:00If I am not mistaken there are just a couple of la...If I am not mistaken there are just a couple of languages like chinese dialects and korean dialects that need the 4 byte utf 16 char. If you do not have characters from that language you can safely say each character is a wchar and that an ascii is 256*ascii value and that the end char is \0\0 . The utf 8 can use 1,2,3,4,5 chars depending on the case. It you have a text with both ASCII and wide-chars in UTF-8 is a pain to work with it. Nightcrawlerhttps://www.blogger.com/profile/07909464974499667392noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-90048146248249412742015-05-11T17:26:33.313-07:002015-05-11T17:26:33.313-07:00Sorry, no. I haven't had time to work on this....Sorry, no. I haven't had time to work on this.Ben Lynnhttps://www.blogger.com/profile/09117417699962852340noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-88223607735678043132015-05-11T16:36:49.688-07:002015-05-11T16:36:49.688-07:00Hi Ben, Do you have a version of blt for non-strin...Hi Ben, Do you have a version of blt for non-strings similar to your implementation for CBT?Nishahttps://www.blogger.com/profile/02796733439310993064noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-26502472367852845512014-07-31T22:44:49.028-07:002014-07-31T22:44:49.028-07:00http://www.forbes.com/sites/insertcoin/2014/07/17/...http://www.forbes.com/sites/insertcoin/2014/07/17/kim-kardashian-may-make-85-million-from-her-video-game/ can we build something like this? =)Emilyhttps://www.blogger.com/profile/03391128607315336031noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-91300052378557371572014-04-16T09:34:50.016-07:002014-04-16T09:34:50.016-07:00Thanks! I corrected it.Thanks! I corrected it.Ben Lynnhttps://www.blogger.com/profile/09117417699962852340noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-82308678762708307452014-04-16T03:04:05.692-07:002014-04-16T03:04:05.692-07:00"1,2,3 correspond to the consonants l,m,n&quo..."1,2,3 correspond to the consonants l,m,n"<br /><br />I think you mean, "l, n, m", right?Theophilushttps://www.blogger.com/profile/05723179159363413154noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-46298175227211262302014-01-19T18:16:33.865-08:002014-01-19T18:16:33.865-08:00Theodore, I can't tell if you're making a ...Theodore, I can't tell if you're making a joke or serious. Assuming the latter, it's true that during examination of an 8-bit value on a modern processor it "wastes" a 64-bit register, but the moment the examination is done that 64-bit register gets used for something else. If you insisted that it be stored as 64 bits in memory and on disk, you would be wasting lots of bits, and introducing endian issues.Shayhttps://www.blogger.com/profile/03239008241308720922noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-3421067335732411572013-12-20T10:09:12.747-08:002013-12-20T10:09:12.747-08:00My experiences have been similar, e.g. I wrote a g...My experiences have been similar, e.g. I wrote a goyacc-compatible lexer for Go (http://cs.stanford.edu/~blynn/nex). But I still use C when I want speed.Ben Lynnhttps://www.blogger.com/profile/09117417699962852340noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-19284215313964467412013-12-20T09:24:33.396-08:002013-12-20T09:24:33.396-08:00Blast from the past! I haven't used Flex or Bi...Blast from the past! I haven't used Flex or Bison since almost 20 years ago when I used them for in-house tools and products involving parsing. I remember being happy about the Flex "reentrant" option, and then also getting into C++ and using C++ for both Flex and Bison to create nicely encapsulated parsers. I should still have all that code around somewhere backed up. In 1995 I did switch away from C/C++ when possible though, and ended up creating my in-house parsing apps in ML (mlyacc, mllex) and then Haskell (Happy) instead... And now I'm still parsing, but using Scala. It never ends.Franklin Chenhttps://www.blogger.com/profile/14762341306710286314noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-4931036898558671942013-11-10T21:19:24.441-08:002013-11-10T21:19:24.441-08:00Those drivers are obsolete now. You'll want t...Those drivers are obsolete now. You'll want to install the <b> xserver-xorg-video-nouveau </b> package.Eli Ihttps://www.blogger.com/profile/15097688529932117506noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-86463987884408122352013-08-28T10:26:39.074-07:002013-08-28T10:26:39.074-07:00This comment has been removed by the author.Oscarhttps://www.blogger.com/profile/11050976057373729736noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-65239665303642704842013-08-28T10:26:27.316-07:002013-08-28T10:26:27.316-07:00Hi Ben, I downloaded the git magic tutorial reposi...Hi Ben, I downloaded the git magic tutorial repository. And I have translated to spanish secrets.txt file, but cannot send to you. Can you give me some access, if you want... thanks.Oscarhttps://www.blogger.com/profile/11050976057373729736noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-905730564342593082013-07-27T13:36:14.168-07:002013-07-27T13:36:14.168-07:00Question 2 is incorrect. Hashtable rehash() does n...Question 2 is incorrect. Hashtable rehash() does not recursively call put(). Instead, it builds the new table by directly indexing into the table array.Bob Fosterhttps://www.blogger.com/profile/03976384333510572229noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-620484732270727782013-07-19T09:17:46.348-07:002013-07-19T09:17:46.348-07:00The sad part is that given 64 bit processors and o...The sad part is that given 64 bit processors and operating systems, ALL lesser word encoding systems are actually obsolete. Your UTF-8 encoding is just going to end up taking up 8 bytes, just like the UTF-16 and UTF-32 will, and you're going to have a bunch of wasted bits regardless.Theodore M. Seeberhttps://www.blogger.com/profile/13315945417122366201noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-84613070060496592142013-02-28T00:16:56.150-08:002013-02-28T00:16:56.150-08:00Haha... I remember Nathan had the same take on pro...Haha... I remember Nathan had the same take on probability for everything.. either it happens or it doesn't, so its 50/ 50!Pandahttps://www.blogger.com/profile/05375098810544202007noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-66501378006608065642013-02-19T21:09:55.642-08:002013-02-19T21:09:55.642-08:00Thanks for the links. Since you brought up the bay...Thanks for the links. Since you brought up the bayesian approach, I thought I should point you to "Doing Bayesian Data Analysis", a book by John Kruschke of which I've only heard good things especially with respect to accessibility and usefulness.<br />http://www.indiana.edu/~kruschke/DoingBayesianDataAnalysis/Suyog Chandramoulihttps://www.blogger.com/profile/14327987483304767294noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-67607938454590934372012-08-26T21:13:28.448-07:002012-08-26T21:13:28.448-07:00I have been! Very slowly, but surely.
A while bac...I have been! Very slowly, but surely.<br /><br />A while back I publicly complained about some article titled "Is Algebra Necessary?". And just now, I finally posted my notes on return-oriented programming. It's fairly boring, but it contains a couple of bonus rants!Ben Lynnhttps://www.blogger.com/profile/09117417699962852340noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-74249609463459969042012-08-25T16:09:58.101-07:002012-08-25T16:09:58.101-07:00If such things still interest you, you must check ...If such things still interest you, you <i>must</i> check out Richard Bird's elegant Sudoku solver.Norman Ramseyhttps://www.blogger.com/profile/09978607749924956287noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-13586731290139791822012-08-25T15:54:41.277-07:002012-08-25T15:54:41.277-07:00Please rant and rave.Please rant and rave.Norman Ramseyhttps://www.blogger.com/profile/09978607749924956287noreply@blogger.comtag:blogger.com,1999:blog-4222267598459829544.post-44983523442207141902012-05-12T14:13:57.976-07:002012-05-12T14:13:57.976-07:00@fnl: All those who keep crying that UTF-32, UCS-2...@fnl: All those who keep crying that UTF-32, UCS-2 or UTF-16+additional assumptions give constant-time code point counting or indexing, just miss one point—the number of real-world applications of this "code point counting" is <i>exactly zero</i>.<br /><br />Typical counter argument I hear is, e.g., limiting a size of some field. But such limits arise when some low-level code (like databases or protocols) allocate a fixed amount of memory for that field, in which case the limit is on the number of code <i>units</i>, not code <i>points</i>.Yakov Galkahttps://www.blogger.com/profile/07160586909390911637noreply@blogger.com