Re: picolisp db encryption?
On Tue, Jan 28, 2025 at 11:40 AM Alexander Burger wrote: > Also, I'm not sure if this is really useful, as it could always be > locally intercepted. > Yes. Any prog doing this would have to implement something to get keys securely for use. > Needs more thinking ... > I agree. Thanks Alex!
Re: Yet Another JSON Parser
On Fri, Jan 31, 2025 at 12:20 PM wrote: > Great. You can never have too many tests. Test your code now too. > > Take the tests from repo and have fun. > > https://git.envs.net/mpech/pil-json > > > (mike) > Wow. That is a great collection of tests, with good insight into how to write my own as well. Thanks for sharing. At a glance I can see several things I will tighten up in the code I wrote, but there are also quite a few where I chose to be relaxed in what the parser accepts. e.g. Trailing commas, unquoted values (in some cases), and empty object and array values which are returned as (NIL . "undefined"). I have updated the wiki page to clarify that. /Lindsay
Re: Yet Another JSON Parser
Hey Lindsay, Good thing you're having fun writing useful projects! I wrote a small parser myself for picolisp so here's a few points for improvement: - Data on json.org is not a full spec, I recommend using ECMA404 or RFC8259, as they specify behaviours way more accurately. For example, I'm not sure if i saw if it can parse UTF-16 surrogate pairs (this lets you parse encoded emojis), which is specified in the RFC. - Look into `loop`, it can make your code quite a bit neater. For example most of the NotDone flags could be removed by using loop conditionals. - You can probably use make and link in more cases, but I'm not sure if it's better than current approach, @abu probably knows. - Check out https://picolisp.com/wiki/?simplerfc8259json if you want some inspiration (maybe into direction of "oh god this is horrible", I don't mind :D) Have fun! Geri On Fri, Jan 31, 2025, 21:45 Lindsay Lawrence wrote: > Hi, > > I added another page to the Examples section of the wiki. > > https://picolisp.com/wiki/?Documentation#yajson > > Aside from the code, I included several examples of use, along with > 'bench' times and a somewhat detailed description. All examples can be run > from the repl and more can be found on the linked github page. > > As a beginning/intermediate picolisp programmer, I've found it can be a > challenge to progress forward from 'academic' code, and simple examples, to > more complex applications, to discovering new insight into functionality > and how to apply the language. Developing bottom-up from the repl is a > great way to do that. Hopefully, the included examples are useful to others. > > /Lindsay > > > >
Yet Another JSON Parser
Hi, I added another page to the Examples section of the wiki. https://picolisp.com/wiki/?Documentation#yajson Aside from the code, I included several examples of use, along with 'bench' times and a somewhat detailed description. All examples can be run from the repl and more can be found on the linked github page. As a beginning/intermediate picolisp programmer, I've found it can be a challenge to progress forward from 'academic' code, and simple examples, to more complex applications, to discovering new insight into functionality and how to apply the language. Developing bottom-up from the repl is a great way to do that. Hopefully, the included examples are useful to others. /Lindsay
Re: Yet Another JSON Parser
On 31-01-2025 20:32, Lindsay Lawrence wrote: I added another page to the Examples section of the wiki. https://picolisp.com/wiki/?Documentation#yajson Aside from the code, I included several examples of use, along with 'bench' times and a somewhat detailed description. All examples can be run from the repl and more can be found on the linked github page. Great. You can never have too many tests. Test your code now too. Take the tests from repo and have fun. https://git.envs.net/mpech/pil-json (mike)