"Best" Web Technology (necro)
-
What's the consensus after 12 years?
-
@stillwater Consensus? The only consensus is that there is no consensus.
-
@stillwater said in "Best" Web Technology (necro):
What's the consensus after 12 years?
Why not just necro the actual topic?
-
@ben_lubar said in "Best" Web Technology (necro):
Why not just necro the actual topic?
... and then delete the necro-post?
-
@stillwater said in "Best" Web Technology (necro):
What's the consensus after 12 years?
The best web technology is when Spiderman had spinnerets in his wrists. None of those stupid huge 80's bracelets with plastic pumps in the palms.
-
@ben_lubar I would have but was told that necroing a thread is considered bad cos people would have to go through the entire thread or something like that.
-
For me the web is generally best on a desktop. Phones are sometimes convenient but they're just way too small. Tablets don't have a real keyboard. Laptops can be OK but often the monitor is small and I hate trackpads.
So: Definitely desktop computers.
-
@stillwater said in "Best" Web Technology (necro):
@ben_lubar I would have but was told that necroing a thread is considered bad cos people would have to go through the entire thread or something like that.
Yes, people will yell about that. That's apparently part of the fun of necroing a thread.
-
@KattMan said in "Best" Web Technology (necro):
The best web technology is when Spiderman had spinnerets in his wrists.
What about the movie where it was like some kind of organic slime mutation thing.
-
@stillwater said in "Best" Web Technology (necro):
What's the consensus after 12 years?
My website still works ~20 years after most of it was made, so HTML. I think it's reasonably stable and usable by this point, though you should probably stay away from some of the newer junk they've added.
-
@Parody said in "Best" Web Technology (necro):
though you should probably stay away from some of the newer junk they've added
A.K.A. JavaScript
-
@Parody said in "Best" Web Technology (necro):
My website still works ~20 years after most of it was made, so HTML
For all the "Oh HTML is not even a real programming language" going around, atleast it works and does not make you go completely mental unlike most things in the front-end world.
-
Rust to wasm.
-
#7612 Upâ +1/1 Downâ [Report] 2018-05-27 12:00 GMT <j_ey> eval: println!("{:?}", std::borrow::Cow::from(vec![1, 2, 3].into_boxed_slice())) -eval- error[E0277]: the trait bound `std::borrow::Cow<'_, _>: std::convert::From<std::boxed::Box<[{integer}]>>` is not satisfied -eval- ~~~ Full output: https://play.rust-lang.org/?gist=04234cc0057890e32c9d23c790870edc&version=stable&mode=debug <sebk> j_ey: I guess you have to define your own cow <sebk> CowSlice ? <j_ey> Beef<>
-
@TwelveBaud Well, that one's obvious. It doesn't know what the vec type is - if you changed it to
vec![1_i32, 2_i32, 3_i32]
, I imagine it'd work.
-
@pie_flavor
error[E0277]: the trait bound `std::borrow::Cow<'_, _>: std::convert::From<std::boxed::Box<[i32]>>` is not satisfied
-
@TwelveBaud Ah, my mistake. There isn't a From impl for any kind of Box. However, Box, like all smart pointers, can dereference to an actual pointer. So what you can do is:
println!("{:?}", std::borrow::Cow::from(&vec![1, 2, 3].into_boxed_slice() as &[_]));
-
@pie_flavor said in "Best" Web Technology (necro):
@TwelveBaud Ah, my mistake. There isn't a From impl for any kind of Box. However, Box, like all smart pointers, can dereference to an actual pointer. So what you can do is:
println!("{:?}", std::borrow::Cow::from(&vec![1, 2, 3].into_boxed_slice() as &[_]));
To someone who doesn't speak Rust, that looks like line noise mixed with colon cancer. Special magic characters everywhere!
-
@pie_flavor I gather the Mozilla developers in that channel eventually figured that out. But you would hope the people that write the language would know how to write code in the language. Or at least make that particular use case easier.
-
@TwelveBaud said in "Best" Web Technology (necro):
@pie_flavor I gather the Mozilla developers in that channel eventually figured that out. But you would hope the people that write the language would know how to write code in the language. Or at least make that particular use case easier.
The idea is to make an easy to use language, not an obscenely sugary language. They don't need to support everything that derefs to
&[T]
because they support&[T]
; calling the conversion methods is something you should be doing.
-
@Benjamin-Hall said in "Best" Web Technology (necro):
@pie_flavor said in "Best" Web Technology (necro):
@TwelveBaud Ah, my mistake. There isn't a From impl for any kind of Box. However, Box, like all smart pointers, can dereference to an actual pointer. So what you can do is:
println!("{:?}", std::borrow::Cow::from(&vec![1, 2, 3].into_boxed_slice() as &[_]));
To someone who doesn't speak Rust, that looks like line noise mixed with colon cancer. Special magic characters everywhere!
I'm not seeing it. Call
println!
, with format string{:?}
, with the result of calling the functionfrom
on the enumCow
within the modulestd/borrow
, passing in as an argument a vector literal, with the methodinto_boxed_slice
called, pointerized, and cast to a slice of whatever type is applicable.
-
@pie_flavor Stop speaking Rust and try.
-
-
@pie_flavor Which part (or parts) would you say is/are giving the most difficulty here? There are 5 words in total, the space for confusion seems limited.
It seems we can safely eliminate "speaking Rust" as a variant of that idiom was recognized without complaint in a recent post. We're left with "Stop" (or perhaps the pairing of "Stop" with an action), "and", and "try". So, either you don't understand what I meant by "try", or they were right about that curfew thing all along.
Anyway, with that framing established, what exactly is in fact the fuck wrong with you?
-
@Gribnit The sentence part. Edit: To the 'most difficulty' question, not the 'with you' question.
-
@pie_flavor so you're having period issues. okay.
-
-
@Parody said in "Best" Web Technology (necro):
@stillwater said in "Best" Web Technology (necro):
What's the consensus after 12 years?
My website still works ~20 years after most of it was made, so HTML. I think it's reasonably stable and usable by this point, though you should probably stay away from some of the newer junk they've added.
Mine, too. Most of it, anyway. The VRML part, not so much.
Well, it would if my server were connected to a network. And a power cord.
-
-
@Tsaukpaetra I am uncertain about the significance of "oh wow..."
-
@HardwareGeek said in "Best" Web Technology (necro):
@Tsaukpaetra I am uncertain about the significance of "oh wow..."
Its significance can be anything you want it to be....
-
@Tsaukpaetra Ok, I have decided that it means you are overwhelmed by my amazing VR modelling skillz.
-
@pie_flavor said in "Best" Web Technology (necro):
The idea is to make an easy to use language
@pie_flavor said in "Best" Web Technology (necro):
println!("{:?}", std::borrow::Cow::from(&vec![1, 2, 3].into_boxed_slice() as &[_]));
@Benjamin-Hall said in "Best" Web Technology (necro):
To someone who doesn't speak Rust, that looks like line noise mixed with colon cancer
Yup.
-
@stillwater Well, that's the one-liner version. Cromulently, it'd be more like this:
use std::borrow::Cow; fn whatever() { let boxed = vec![1, 2, 3].into_boxed_slice(); let cow = Cow::from(&boxed as &[_]); println!("{:?}", cow); }
-
@pie_flavor This whole discussion is mooooot.
-
@pie_flavor said in "Best" Web Technology (necro):
@stillwater Well, that's the one-liner version. Cromulently, it'd be more like this:
use std::borrow::Cow; fn whatever() { let boxed = vec![1, 2, 3].into_boxed_slice(); let cow = Cow::from(&boxed as &[_]); println!("{:?}", cow); }
I ('ve tried to) know a little Rust, but not enough to know why you need to cast
&boxed
as&[_]
. Shouldn'tboxed
already be a slice?Edit: asking @pie_flavor about slices is making me hungry.
-
Trying to compile this:
use std::borrow::Cow; fn main() { let boxed = vec![1, 2, 3].into_boxed_slice(); let cow = Cow::from(&boxed); println!("{:?}", cow); }
Results in:
Compiling playground v0.0.1 (file:///playground) error[E0277]: the trait bound `std::borrow::Cow<'_, _>: std::convert::From<&std::boxed::Box<[{integer}]>>` is not satisfied --> src/main.rs:5:15 | 5 | let cow = Cow::from(&boxed); | ^^^^^^^^^ the trait `std::convert::From<&std::boxed::Box<[{integer}]>>` is not implemented for `std::borrow::Cow<'_, _>` | = help: the following implementations were found: <std::borrow::Cow<'a, std::ffi::OsStr> as std::convert::From<std::ffi::OsString>> <std::borrow::Cow<'a, std::ffi::OsStr> as std::convert::From<&'a std::ffi::OsString>> <std::borrow::Cow<'a, std::ffi::OsStr> as std::convert::From<&'a std::ffi::OsStr>> <std::borrow::Cow<'a, std::path::Path> as std::convert::From<&'a std::path::Path>> and 11 others = note: required by `std::convert::From::from` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. error: Could not compile `playground`.
I found a cargo-cultish solution of:
use std::borrow::Cow; fn main() { let boxed = vec![1, 2, 3].into_boxed_slice(); let cow = Cow::from(&*boxed); // deref coercion println!("{:?}", cow); }
But I still don't follow why "the trait
std::convert::From<&std::boxed::Box<[{integer}]>>
is not implemented for `std::borrow::Cow<'_, _>".Edit: okay, my brain is starting to wake up, so I'm starting to see that Cow doesn't go around implementing random From specializations; namely, there's no reason to believe a random borrowed box of ints can be copy-on-written. So that's why we have to tell it that this one in particular can be.
-
@TwelveBaud said in "Best" Web Technology (necro):
std::borrow::Cow::from(vec![1, 2, 3].into_boxed_slice()))
Why
into_boxed_slice
??â˝? Owned form (as perstd::borrow::ToOwned
) of[T]
isVec<T>
, so you should simplystd::borrow::Cow::from(vec![1, 2, 3])
directly. Not that it made much more sense anywayâsince[1, 2, 3]
is'static
,std::borrow::Cow::from(&[1, 2, 3])
is, shorter, more efficient and for all other purposes equivalent.@Benjamin-Hall said in "Best" Web Technology (necro):
To someone who doesn't speak Rust, that looks like line noise mixed with colon cancer. Special magic characters everywhere!
You'd have that in most other languages too, given it's unnecessary convoluted. The explicit conversions do make it a bit more complicatedâbut usually you can shorten them to a signle
into()
(if the above was in a context that actually requested aCow
, the expression would be just[1, 2, 3].into()
.
-
I'll be more specific ;-) :
-
@Zecc said in "Best" Web Technology (necro):
Cow doesn't go around implementing random From specializations
Does it implement Cud.chew()?
-
@Zecc Why are C++ people such garbage.
-
@blakeyrat said in "Best" Web Technology (necro):
@Zecc Why are C++ people such garbage.
Hey, don't blame us! That ain't C++!
-
@Zecc Deref conversions only happen when it knows it's supposed to do it. Cow has many From implementations, and an alternate trait implementation could potentially break your code from a crate inclusion. For this reason you only get deref conversions when it's a struct function and not a trait function.
I did in fact forget about&*boxed
working rather than needing&boxed as &[_]
.
-
@Bulb said in "Best" Web Technology (necro):
@TwelveBaud said in "Best" Web Technology (necro):
std::borrow::Cow::from(vec![1, 2, 3].into_boxed_slice()))
Why
into_boxed_slice
??â˝? Owned form (as perstd::borrow::ToOwned
) of[T]
isVec<T>
, so you should simplystd::borrow::Cow::from(vec![1, 2, 3])
directly. Not that it made much more sense anywayâsince[1, 2, 3]
is'static
,std::borrow::Cow::from(&[1, 2, 3])
is, shorter, more efficient and for all other purposes equivalent.@Benjamin-Hall said in "Best" Web Technology (necro):
To someone who doesn't speak Rust, that looks like line noise mixed with colon cancer. Special magic characters everywhere!
You'd have that in most other languages too, given it's unnecessary convoluted. The explicit conversions do make it a bit more complicatedâbut usually you can shorten them to a signle
into()
(if the above was in a context that actually requested aCow
, the expression would be just[1, 2, 3].into()
.This. If you're cowing a boxed vector slice, you're already doing it wrong.
-
@null1 said in "Best" web technology?:
(probably MySQL, though I am open to
suggestions)Why not MongoDB? I hear it can be used to emulate Redis.
-
@Greybeard Because that post was made 3 years before MongoDB even existed?
-
@Bulb said in "Best" Web Technology (necro):
@Greybeard Because that post was made 3 years before MongoDB even existed?
Future-sight being -300/500....
-
@Greybeard Lotus Notes can also be used to simulate Redis...
-
By the way, here's how you borrow a cow on Ubuntu:
ben@australium:~$ apt moo (__) (oo) /------\/ / | || * /\---/\ ~~ ~~ ..."Have you mooed today?"...
-
@Greybeard said in "Best" Web Technology (necro):
@null1 said in "Best" web technology?:
(probably MySQL, though I am open to
suggestions)Why not MongoDB? I hear it can be used to emulate Redis.
PostgreSQL can be used to emulate Redis, but we're trying to find a way to stop it from doing that.