u/BeniBela - 26 Archived Voat Posts in v/programming
u/BeniBela
  • home
  • search

u/BeniBela

3 posts · 23 comments · 26 total

Active in: v/programming (26)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: quiz. write a function recurseList(f,x,n) that returst a list, [f(x), f(f(x)), ...], length n.

XQuery:

declare function recurseList($f, $x, $n) {
   let $fx := $f($x) return
   if ($n = 1) then $fx 
   else ($fx, recurseList($f, $fx, $n - 1))
}
2 02 Nov 2017 12:49 u/BeniBela in v/programming
Comment on: Let's play a game! (Instructions inside)

Is it i?

4 19 Apr 2017 14:39 u/BeniBela in v/programming
Comment on: curl is C | daniel.haxx.se

Xidel is Pascal

0 29 Mar 2017 16:36 u/BeniBela in v/programming
Comment on: Birds

Are those birds? Not really. Are those planes? No. Are those supermen? No! Those are parentheses!

Is it LISP? No!

0 03 Feb 2017 15:30 u/BeniBela in v/programming
Xidel 0.9.6 released: My cli XPath/XQuery-interpreter focused on HTML and JSON processing
0 0 comments 22 Nov 2016 18:05 u/BeniBela (..) in v/programming
Comment on: Swift vs Go vs Rust - which one will win the battle of the future?

Why not D?

Or Object Pascal?

1 04 Nov 2016 16:13 u/BeniBela in v/programming
Comment on: [Humor] How to save the princess using 8 programming languages

You just need to apply the rescue function on the princess in the world monad, but it is too lazy to do that.

4 06 Oct 2016 16:59 u/BeniBela in v/programming
Comment on: I just spent 12h in Delphi trying to fix fatal bug. At the end I had to check almost line per line until I removed a '\' character from a string.

You think he will still looking in one or two years? I might need to find a job then.

0 26 Sep 2016 17:00 u/BeniBela in v/programming
Comment on: I just spent 12h in Delphi trying to fix fatal bug. At the end I had to check almost line per line until I removed a '\' character from a string.
 i^.somemethod()

In old Pascal

Delphi usually allows just i.somemethod()

After all, a raw pointer has no methods

0 26 Sep 2016 17:00 u/BeniBela in v/programming
Comment on: I just spent 12h in Delphi trying to fix fatal bug. At the end I had to check almost line per line until I removed a '\' character from a string.

Why would the string matter? Was there not some input validation?

I just spent days figuring out why my program did not start after updating to the newest freepascal 3.0 release.

Turns out it was a known bug in Android that has been fixed in freepascal trunk.

So they told me to update to 3.1.1, which I did. Afterwards freepascal crashed when compiling my program.

0 26 Sep 2016 16:58 u/BeniBela in v/programming
Comment on: I just spent 12h in Delphi trying to fix fatal bug. At the end I had to check almost line per line until I removed a '\' character from a string.

On the other hand I work on a project where eslint was set up, so that you have to remove all trailing semi-colons, or it complains

0 26 Sep 2016 16:52 u/BeniBela in v/programming
Comment on: Will being a programmer become a near minimum wage occupation?

whose eyes glaze over the moment I start talking about pointers

I always start looking glazely in such conversations, but I assume that will nothing be said that I do not either already know or else could google in case I need it

1 23 Sep 2016 22:54 u/BeniBela in v/programming
Comment on: Will being a programmer become a near minimum wage occupation?

Also, is there any way to make gdb display several lines of code around the line of code it's currently executing?

list

1 23 Sep 2016 22:52 u/BeniBela in v/programming
Comment on: Delphi (Object Pascal) IDE Starter Edition is temporary free, few days left.

I was not comparing old Delphi to new Delphi.

I was comparing old Delphi to non-Delphi

0 16 Sep 2016 22:45 u/BeniBela in v/programming
Comment on: Delphi (Object Pascal) IDE Starter Edition is temporary free, few days left.

and it was amazing how much more advanced it was in comparison.

The form designer still is

16-bit Delphi on Windows 3.11 in the 90s: You put a component on the form. Done. Nothing else to do for the programmer. Delphi automatically made it a field of the corresponding form class and you could access the component. It has the correct type and is always correctly initialized.

Android form designer, 2016: You put a view on the layout. It gets an id, but if you want to access it you need to call findViewById. And you need to cast it to the correct type. And you need to declare a variable to store it in. Or your own class field. Then you add another view on an unrelated layout and all the ids change, and it crashes or does not compile, till you make a clean build and recompile the entire project. Because? Because it is no Delphi, that's why

0 11 Sep 2016 11:50 u/BeniBela in v/programming
Comment on: Delphi (Object Pascal) IDE Starter Edition is temporary free, few days left.

Damn, missed it by two days

0 11 Sep 2016 10:38 u/BeniBela in v/programming
Comment on: In search of the perfect URL validation regex

What about IPv6 urls?

And relative URLs are important for most people, too

Once I made a URL-validation regex from the RFC itself, a regex for every BNF token and then replace every usage of that token with that regex. I had to patch the regex library, because the regex became too long for it. But it still did not work.

1 10 Jun 2016 22:12 u/BeniBela in v/programming
Xidel 0.9.4 released. My programming language has evolved into a full XQuery 3.0 interpreter
2 0 comments 09 Jun 2016 15:08 u/BeniBela (..) in v/programming
Comment on: So I've spent 7 years to write an oss interpreter for a language that can pattern match webpages and is XQuery compatible, and then Reddit's mods just delete my submission

thrilled to see new programming languages (and pl authors) here, what do you mean by "jquery compatible?" meaning jquery can do selectors on it like it can for plain js, or that your project uses jquery?

I mean XQuery. It is like a Turing-complete XPath.

In the beginning I was making my own extended-XPath language, but then I noticed I am just reinventing what the W3C made years ago.

if there is a manual or language reference (or even a tutorial) id love a link to it. congrats, im glad you have a new place to share it.

XQuery has a super long standard.

Although they only talk about XML, my implementation is for HTML. Perhaps I should call it HQuery.

im more interested in people sharing new languages here than i am in most programming topics (if you start /v/programminglanguages or /v/proglangs i will join)

I am not sure there are enough languages posts to fill a subvoat

1 19 Jul 2015 01:28 u/BeniBela in v/programming
Comment on: So I've spent 7 years to write an oss interpreter for a language that can pattern match webpages and is XQuery compatible, and then Reddit's mods just delete my submission

All of sourceforge is dead :(

You would think they could have fixed it after 2 days. Too bad none of the other oss hosters supports websites written in Pascal.

Some mirrors of the non interactive stuff:

Thingy Github Bitbucket My site
Xidel/frontend source https://github.com/benibela/xidel http://bitbucket.org/benibela/xidel http://hg.benibela.de/xidel
Library/backend source https://github.com/benibela/internettools http://bitbucket.org/benibela/internettools http://hg.benibela.de/internettools/
Library documentation - - http://www.benibela.de/documentation/internettools/
1 18 Jul 2015 22:29 u/BeniBela in v/programming
Comment on: So I've spent 7 years to write an oss interpreter for a language that can pattern match webpages and is XQuery compatible, and then Reddit's mods just delete my submission

I can't say I really understand what the tool is doing ...

It is a Turing-complete programming language.

It can do everything!

The difference to most languages is that the type system contains DOM nodes. So all conversion happen automatically, and you do not really need to distinguish data on a webpage and data used during calculations (although that might get really slow). And the map-filter syntax is really succinct, it neither needs an explicit loop nor an explicit function definition.

4 15 Jul 2015 23:28 u/BeniBela in v/programming
Comment on: So I've spent 7 years to write an oss interpreter for a language that can pattern match webpages and is XQuery compatible, and then Reddit's mods just delete my submission

I actually did submit it to r/software (as suggested by r/opensource), not r/programming

But then I was too annoyed to submit it to latter, too.

And v/software is too tiny

0 15 Jul 2015 23:10 u/BeniBela in v/programming
Comment on: So I've spent 7 years to write an oss interpreter for a language that can pattern match webpages and is XQuery compatible, and then Reddit's mods just delete my submission

Really?

I wrote everything (except the HTTP/S client and regex library). It all goes down to a byte-byte memory comparison function that I wrote to check if two strings are equal.

In an hour, you cannot even finish the HTML parser. Nor read the XQuery standard to find out what you need to implement.

Although the biggest time waster was that I wanted to write my own programming language, and only decided later to make it XQuery-compatible. If I had followed the XQuery standard from the beginning, it might only have taken half the time.

Yet, I will still need 2 years or more to make it really compatible. Because the regex library has a slightly different syntax and I cannot find a replacement. Thus I need to write to write a completely new regex parser. And a new HTML parser, because my parser predates HTML5...

4 15 Jul 2015 20:10 u/BeniBela in v/programming
Comment on: So I've spent 7 years to write an oss interpreter for a language that can pattern match webpages and is XQuery compatible, and then Reddit's mods just delete my submission

If that page is too confusing: left textarea contains the input file, right textarea the interpreted script, and the bottom textarea the evaluated output.

The script is surrounded by <table><td>{ ...}</td></table> which is pattern matched against the input file and returns Hello in the context item .. Afterwards, a higher order function, which calls the function passed as 1st argument with the string in the 2nd parameter shifted by one place, is assigned to the variable $shifthf. $shifthf is partially evaluated with itself as 1st parameter, which creates a recursive function that is assigned to $shift and then called with a string...

And if you have NoScript or something activated, you cannot see anything, because it removes all the parentheses and tags from the url.

1 15 Jul 2015 19:09 u/BeniBela in v/programming
So I've spent 7 years to write an oss interpreter for a language that can pattern match webpages and is XQuery compatible, and then Reddit's mods just delete my submission
42 12 comments 15 Jul 2015 18:59 u/BeniBela (..) in v/programming
Comment on: Am I wasting my time?

I'm currently in an intro to programming class and my professor always stresses that it's not about the language you learn, but that you learn how to think like a programmer and design programs

They told me that, too, so I learned Pascal.

Then I could not find a job.

Liars!

1 13 Jul 2015 19:23 u/BeniBela in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.