What are you working on? - Programming On Unix
Tmplt
Currently working on bookwyrm's downloading component. I began by using cpr, a spiritual port of Python's requests to C++, but it lacks some features I will require in the future. So now I'm learning to do the same things with libcurl.

EDIT: so far I've submoduled all dependencies in a lib/ directory. Should I do this with curl also, or is it safe to presume it (and its headers) are already installed on the users system? Or should I ask users to install that before building?
resk
(02-12-2017, 06:54 PM)Tmplt Wrote: I began by using cpr, a spiritual port of Python's requests to C++, but it lacks some features I will require in the future.
thanks for sharing, cpr looks neat way easier than doing libcurl.
What exactly is it missing ?
Tmplt
(04-12-2017, 04:05 AM)resk Wrote: cpr looks neat way easier than doing libcurl.
What exactly is it missing ?
streamed requests which, if I understand the term correctly, will be useful for larger files. I want to write them directly to a file, and not store them in memory. I didn't look to closely at the documentation; it's very much possible that I missed something. It also doesn't seem like there is a way to get transer progress from cpr.
jkl
There's one big thing missing when working on Windows: ed(1). The GnuWin32 thingy has the major problem that it's GNU ed, not the good ed. So I thought I'd write my own one in order to procrastinate my other projects. :-D

After diving into (and fleeing from) Rust over the past weekend - what a damn mess of a language! -, I decided to resort to Go until I find the patience to flip the bits with FASM. Doing something serious with FASM is among my long-term plans anyway. -- So, however, I'm accidentally writing a cross-platform ed(1) clone with one MiB of runtime overhead now. Stay tuned.
Tmplt
(04-12-2017, 10:51 AM)jkl Wrote: what a damn mess of a language!
I'm currently taking a course where rust plays a key part, and from the C++ I've written, Rust feels like an improvement overall. I really like pattern matching and the cleaner API on iterators — althrough I've yet to actually write something by myself in it, my opinion might change.

What's so messy about it?
jkl
Slightly OT, but, since you asked me ...

The one big "whoa" with Rust is Cargo. I wish I had something like Cargo.toml for my usual go-to languages: Supplying a Cargo file with the source code is probably the nicest possible way of deploying projects with a number of external dependencies. Comparing that to Makefiles (with all the "download, prepare and find these 365 libraries first" stuff) makes me wonder why it has to be so complicated in every other language I know.

The language's syntax, however, is bizarre:

1. unwrap() weirdness
Why does everything have to be "wrapped" in weird "types" like Option<> and Box<>? One of the first thing I tried was a simple "print_usage()" method that cuts the path (./myApp instead of /my/very/long/and/boring/path/containing/the/myApp). Adequately easy in sane languages, annoying in Rust:
Path::new(program).file_name().unwrap().to_str().unwrap()
(It is well possible that there are more elegant approaches to this. But I totally lost my interest in figuring them out.)

2. everything is a macro
In theory, there is nothing wrong with that, but it feels wrong that even "println" is not a function.

3. Haskell, Haskell everywhere
I was hoping that Rust could be "like C++, but better" - but it is quite different than C++, it rather mimicks as a F#/Haskell sibling with its underscores and its arrows and the lambda stuff. Functional programming sucks. (YMMV.)

4. variables are immutable
A variable is called a variable because its contents can vary. If they can't, it's a constant. Except in Rust where everything is a constant by default unless marked otherwise. Why?

5. string confusion
Strings are not &strs are not pointers. Who said C's string handling was complicated?

6. no global static variables
... except if you add lazy_static or something - which prefers vectors and arrays but struggles with strings. Maybe there are easier ways to provide static runtime "variables" (mutables...), but I just haven't found out how. The documentation could be better IMO. But then again, I only spent Saturday and half of Sunday with Rust - including some sleep.

It might well be because of my limited understanding of the "good design" of Rust or something, but I felt it would require more than just a weekend to even understand something roughly more complicated than "Hello World". I probably gave up rather fast, but, as it stands, Rust is not quite as friendly as Cargo made me think initially. That's sad, but I can live with that.
apk
honestly im just working on trying to get through the semester i mean my god dude i got like 6 programming projects to do and i gotta write a prose story someone throw me a FRIKIN BONE HERE HAHA ALRIGHT
jkl
I was missing a sane way to remove regexes from filenames on Windows. I accidentally wrote a cross-platform solution to that.
https://bitbucket.org/tux_/remv
venam
(14-01-2018, 02:42 AM)jkl Wrote: I was missing a sane way to remove regexes from filenames on Windows. I accidentally wrote a cross-platform solution to that.
So it's a multiplatform `rename(1)`? With the advent of bash on windows won't the rename utility work by itself. I haven't given it a try at all, I'm simply asking.
jkl
More or less: yes. As far as I know, rename(1) is a GNU thing which limits its usefulness for me.
Also, NIH.




Members  |  Stats  |  Night Mode