Deutsch English Français Italiano |
<v82go6$djin$1@solani.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mild Shock <janburse@fastmail.fm> Newsgroups: comp.lang.prolog Subject: =?UTF-8?Q?Re:_Did_Lifeware_Kill_Scryer_Prolog_CLP=28Z=29_=3f_=28Was?= =?UTF-8?Q?:_A_harsh_wind_is_blowing_into_the_face_of_Prolog_now=e2=80=a6_[F?= =?UTF-8?Q?ORTRAN_/_TIOBE_Index_for_May_2024]=29?= Date: Sat, 27 Jul 2024 12:04:55 +0200 Message-ID: <v82go6$djin$1@solani.org> References: <v32hjd$s3qh$1@solani.org> <v808tc$cuh7$1@solani.org> <v8091j$cuh7$2@solani.org> <v82eii$di8g$1@solani.org> <v82f3o$e0v3$1@solani.org> <v82g0u$dj50$1@solani.org> <v82g93$dj8h$1@solani.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 27 Jul 2024 10:04:54 -0000 (UTC) Injection-Info: solani.org; logging-data="446039"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2 Cancel-Lock: sha1:DnINjrB9vCa1Oa8Gv/sEk/vmn+0= In-Reply-To: <v82g93$dj8h$1@solani.org> X-User-ID: eJwNycERACEIA8CWyECIlKOC/Zdwt9+lJ/Iqkhl8fAPy5ehNwZCgSjhb61/sptYxuamj1TwdUQO3i7ra6esDOgAUtA== Bytes: 3103 Lines: 55 Hi, Whats then more disturbing, if you try picking subparts of the parsing string, and integrate them in the parse tree, i.e. your AST. You then definitively lock the whole parsing source. But the parsing source might be a couple of predicate definitions, with constant arguments as found in Datalog: foo(bar, baz) :- .... .... The old school non sharing approach would be to have an atom table and you have then deduplicated foo, bar, baz, etc... in one place and the source doesn't get locked. There is a also a new school, which I started with Jekejeke Prolog and continued with Dogelog Player. You don't share and you don't atom table. If you don't use atom table, you might have copies in your code of foo, bar, baz etc.. But this is only a small factor, the used memory is still lower than locking the whole source. And some Java versions have string deduplication garbage collection under the hood now. I am not sure what Python and JavaScript do. But so far I think the small factor of extra memory usage is not an issue. Bye Mild Shock schrieb: > Hi, > > But such a criteria is not satisfied in parsing, > especially if you use the more advanced last call > optimization and not only tail recursion optimization. > > As soon as parsing is deterministic, you can > leave behind the string part that you already parsed. > So you would need a special sharing that is kind of > > a weak sharing that can free some head part. There is > no such problem of freeing the head part, if you use > proper cons cell based lists for parsing. > > But naive substring sharing doesn't work for Prolog. > It will unnecessarely lock the whole string always. > Whereas a cell based parser can drop > > already parsed parts. > > Bye