[HN Gopher] Req - An HTTP Scripting Language
___________________________________________________________________
Req - An HTTP Scripting Language
Author : elvis70
Score : 78 points
Date : 2022-02-27 13:06 UTC (2 days ago)
(HTM) web link (andrewpillar.com)
(TXT) w3m dump (andrewpillar.com)
| donatj wrote:
| I'd be very interested in using this as an embeddable language in
| a couple of my Go projects.
|
| Glancing at the code, seems easy enough.
|
| If the Author is around, I'm curious if that'd be a supported use
| case? The README makes no note.
| nikeee wrote:
| I recently discovered Hurl, which has a similar idea and I think
| it's great for API integration tests:
|
| https://hurl.dev
| earthboundkid wrote:
| I saw this on Reddit a couple of days ago. Two suggestions:
|
| - Change the symbol -> to | because it's more similar to how pipe
| works in shell than how -> works in C++/PHP.
|
| - Introduce a second way to do string literals, so :hello is
| equivalent to "hello". Then change encode so that its second
| argument is a string instead of a mysterious name. (Read the docs
| but didn't actually understand how it worked under the hood. Is
| it just hardcoded?) So `encode json` becomes `encode :json` (or
| `encode "json"` if the user prefers).
|
| This is a pretty cool project.
| ushakov wrote:
| it's a neat idea, but useless in a form of a programming language
|
| during the pandemic i have started building a declarative (YAML)
| http client for testing APIs which will integrate into CI/CD like
| GitHub
|
| drop me a line if you're interested
| linkdd wrote:
| not particularly interested, but highly curious to what is a
| "declarative client".
| bryanrasmussen wrote:
| JSON and Rebol https://ross-gill.com/page/JSON_and_REBOL
| kbd wrote:
| Oh man, REBOL, blast from the past. If they had open-sourced it
| early instead of trying to promote a proprietary programming
| language we might talk about REBOL along with Python and Ruby.
| Instead, it's forgotten.
| chhickman wrote:
| There has been an open source successor to REBOL called
| Red[1] for years but progress seems to have been pretty
| sporadic.
|
| [1] https://www.red-lang.org/
| t43562 wrote:
| I just started to learn about "Mule" - this makes me think of the
| language it offers to work with APIs (dataweave) - one might want
| to be able to have a way for this language to be extended to
| allow web serving so that one could use it as a way to build new
| simpler APIs from lower level ones.
| kburman wrote:
| Why not use python/ruby?
| chris37879 wrote:
| Python and ruby wouldn't exist if more people asked that
| question. Not all code needs to be a product intended for use.
| spicybright wrote:
| Can you clarify? Do you mean python/ruby wouldn't exist if
| people asked why not use an established language?
| chris37879 wrote:
| Always happy to clarify something I was vague about.
|
| I get asking that question when you're talking about lesser
| known tech, but when someone writes an entire language
| themselves, it's a bit disingenuous to think they don't
| know about two of the largest languages on the planet. It'd
| be more reasonable to ask "What advantages does this have
| over the standard library in python or ruby?". A similar
| question would be looking at ruby or python and wondering
| why you should use those when perfectly good ANSI C exists.
|
| As to the second part of my statement, I hope that's fairly
| obvious, but I'll lay it out explicity: Not all code needs
| to be a product vying for market share to be useful. Some
| code is for the author to learn from, some code is for
| making art, some code is for shits and giggles to throw
| into the world on a lark because someone else might do
| something with it, or learn something from it, or use it to
| solve that _exact_ bug they've been having in something
| just cause they see you did something similar a different
| way.
| donatj wrote:
| I'd say the lack of need of a particular interpreter makes this
| a lot more portable and usable.
|
| A tool written in Python or Ruby will always be most usable by
| Python or Ruby developers. A tool written in Go and compiled to
| a single binary has no such barrier to entry.
| seanw444 wrote:
| The author said he wanted to build something that incorporated
| the things he learned while going through some "How to build a
| compiler in Go" books, not necessarily for anything
| particularly useful.
| jamescun wrote:
| Great idea! I have a similar, long forgotten, idea in the
| projects folder also called "req". Look forward to seeing this
| develop!
| unfocussed_mike wrote:
| I would like to read this, but unfortunately my eyes are in their
| late forties even if my brain is only 25.
|
| Very occasionally I bump up the font size a notch in Chrome to
| make things a little easier when I am tired. Even HN
| occasionally.
|
| I've not had to bump it up _three_ notches before now. 12px serif
| body text in 2022? Ouch :-/
| rmbyrro wrote:
| Yep, 200% zoom needed here
| OJFord wrote:
| Looks great to me, I zoom _out_ twice (80%) by default, often
| going a third (67%) per site; this looks nice to me at 100%.
|
| I'll get there one day I suppose and should enjoy it while it
| lasts, but for now most stuff really does look comically large
| and content-less.
| IceWreck wrote:
| I had to zoom it to 200% to read on my laptop.
| xboxnolifes wrote:
| Oh no, you had to use a feature of your browser for it's
| intended use-case.
| dang wrote:
| Please don't be a jerk in HN comments. It's not what this
| site is for, and it destroys what it is for.
|
| https://news.ycombinator.com/newsguidelines.html
| nojonestownpls wrote:
| Reader Mode in Firefox is a godsend for this. Instead of click
| after click on the Zoom+ button (or Ctrl-+), trying to see how
| many it takes, it's a single click to immediately get things
| into exactly the font, width, and colour I want.
| unfocussed_mike wrote:
| Yeah -- I use Safari's reader mode on the iPad a lot. But I
| have muscle memory for page-zoom on desktop!
| donatj wrote:
| >12px serif body text in 2022
|
| Hacker News, and in fact this comment are 12px. Something's up
| with this site that's making it extra tiny.
|
| Update: Proof - https://jdon.at/ZVirr2
| unfocussed_mike wrote:
| Good spot.
|
| Though this comment is not 12px Serif, it is 12px sans-serif
| (and Verdana at that). Which makes a really significant
| difference with small fonts.
|
| It's also not body text on a blog article; this size of text
| is really too small for long-form reading (which admittedly
| includes all of my bloviating HN comments, natch)
| Arkanosis wrote:
| It's sans-serif, hence the difference.
|
| What's extremely interesting is that on my laptop, HN is 12px
| when Firefox is full screen, but 13.33px when Firefox only
| uses the left or right half of my screen.
| unfocussed_mike wrote:
| > What's extremely interesting is that on my laptop, HN is
| 12px when Firefox is full screen, but 13.33px when Firefox
| only uses the left or right half of my screen.
|
| Yeah -- this is a common strategy for mobile rendering
| which on the face of it seems quite counterintuitive, but
| actually isn't.
| Garlef wrote:
| Sidenote: The font is very small on this site.
| spicybright wrote:
| Was going to say. 12px is way too tiny.
| lbotos wrote:
| On my Mac in FF, HN is 9pt, which ends up being 12px, but it
| does look larger than the Req site... Oh browsers...
| kroltan wrote:
| Verdana (which is what HN uses at least for me) is a much
| wider font, though.
|
| The website uses Fira Sans, which is very condensed (as
| much as you can without having to stretch the characters,
| in fact).
|
| You can see that the code snippets on the website "look"
| much larger even though they're also 12px, since they are
| set in Courier New.
| alexk307 wrote:
| Nice project, but this is not super useful in practice. HTTP
| itself is a DSL, so this is another DSL around that DSL. I would
| definitely choose curl and bash over any other abstraction, and
| if logic was needed, there are great libraries in every language
| to do this - requests in Python for example. Sounds like a good
| learning experience though!
___________________________________________________________________
(page generated 2022-03-01 23:01 UTC)