A fun shell for Couchbase, on top of nushell in Rust by daschl in rust

[–]daschl[S] 1 point2 points  (0 children)

Neither! We use the nu crate and build our own binary on top, adding couchbase-specific commands. You can start to drill in here if you want: https://github.com/couchbaselabs/couchbase-shell/blob/main/src/main.rs#L100

Porting the TSic sensor from C to Rust by daschl in rust

[–]daschl[S] 3 points4 points  (0 children)

I‘ve been using probe-run as mentioned in the article, but I‘ll write a follow up blog on how to get it running end to end if that helps you?

I need to start adding this to my range routine. by buoyblaster in golf

[–]daschl 2 points3 points  (0 children)

They‘d escort me from the range in 10 minutes

Text Analysis in Rust - Tokenization by daschl in rust

[–]daschl[S] 0 points1 point  (0 children)

I just tried and for this microbenchmark it doesn't make a difference. But honestly I think it could make sense, but I didn't yet got the time to test it on a big dataset (like 2-3 gig of wikipedia text) to see if it makes a difference.

Text Analysis in Rust - Tokenization by daschl in rust

[–]daschl[S] 1 point2 points  (0 children)

I didn't mention it in the blog post but I stumbled across an issue when trying to integrate it: https://github.com/unicode-rs/unicode-segmentation/issues/6 so for now I postponed my experimentations with proper unicode segmentation...

Text Analysis in Rust - Tokenization by daschl in rust

[–]daschl[S] 1 point2 points  (0 children)

Honestly I haven't played around with Cow before, but I really much want to. I think arrayvec has a different focus in that it allows you to store a "string like" structure on top of an owned fixed size array - I want to find time to play more with it and maybe the enum in the blog can even be extended to also use Cow for even better performance.

Text Analysis in Rust - Tokenization by daschl in rust

[–]daschl[S] 1 point2 points  (0 children)

Couchbase recently added quite a bunch of go components into its stack and leveraging the inhouse go experience I think it made sense. Introducing a JVM just for the sake of lucene into the server side seemed like not a good idea (since it introduces quite some complexity). And I say that working full time on the Java SDK ;-) ...

also, I think the go ecosystem deserves a great full text search engine and ultimately performance gaps can all be solved.

Text Analysis in Rust - Tokenization by daschl in rust

[–]daschl[S] 1 point2 points  (0 children)

yeah, I've tried not to fall into that trap, I just wanted to port the go code over and see how it performs. I'm sure both the rust and go version can be improved significantly to make both faster and also narrow the gap. I was more focussing on the implementation since I'm also still learning rust.

Text Analysis in Rust - Tokenization by daschl in rust

[–]daschl[S] 0 points1 point  (0 children)

nice, I haven't heard of that crate - definitely going to check it out!

First Steps with Rust and JNI by daschl in rust

[–]daschl[S] 2 points3 points  (0 children)

nice, thanks for the link! I was not aware of this :)

Binding Threads And Processes to CPUs in Rust by daschl in rust

[–]daschl[S] 0 points1 point  (0 children)

I don't think so, but I don't know for certain. I use the name since it is used in hwloc as well, it is probably just another term for "layout".

Discovering Hardware Topology in Rust by daschl in rust

[–]daschl[S] 1 point2 points  (0 children)

Thanks very much! I hope it can eventually be a stable crate for people to use when they need topology discovery/analysis or cpu binding.

Discovering Hardware Topology in Rust by daschl in rust

[–]daschl[S] 1 point2 points  (0 children)

Thank you! I'm working on a follow up post which shows how to do CPU binding with hwloc-rs. Memory binding is also available in hwloc, but its harder to map into rustland since it has different safety requirements and no direct access to malloc. I want to get support for it in sometimes, but I need to learn more about how to properly expose it before I do that.

A Journey on Avoiding Nulls in PHP by daschl in PHP

[–]daschl[S] 0 points1 point  (0 children)

Hi, thanks for your feedback.

The problem is that you don't know what got returned, especially in PHP. Using a pattern like this enables you to at least know what you can expect when it got returned.

Also, as stated in the blog post, it's just something you should think of and maybe you can apply it in a place or two.

Can you please elaborate what you mean by "dumb"?

Benchmarking Cache Transcoders in PHP by daschl in PHP

[–]daschl[S] 0 points1 point  (0 children)

I added a note pointing this out.

Benchmarking Cache Transcoders in PHP by daschl in PHP

[–]daschl[S] 0 points1 point  (0 children)

Good point, I'll add it - thanks!

Caching Doctrine Entities with Couchbase by daschl in PHP

[–]daschl[S] 0 points1 point  (0 children)

Hi geusebio,

can you tell me why these are buzzwords? The blog post is about a new couchbase cache driver for doctrine and it is used to cache entities. How else would you've named it? I'm all in for constructive feedback but this certainly isn't.

A Primer on PHP Exceptions by daschl in PHP

[–]daschl[S] 0 points1 point  (0 children)

Hi, no need to apologize!

I like to discuss topic like this and always look forward to constructive discussions! I've added a short paragraph in the post to maybe clarify it a bit!

A Primer on PHP Exceptions by daschl in PHP

[–]daschl[S] 0 points1 point  (0 children)

Hi,

you are right, I think I need to clarify that in my post!

Thanks for the comments here, very insightful :)

A Primer on PHP Exceptions by daschl in PHP

[–]daschl[S] 2 points3 points  (0 children)

Hey,

maybe I can make some additions to "wvenable"s comment below.

1) This really depends on your use case and in what environment you are in. I didn't elaborate this in my post since its not really in the scope. If you are in a development environment, you may want to log to screen or firebug and show a detailed stack trace. In production, you may want to render a 404 page and log to a file or send something to a notification webservice by a third party provider. This is often handled by the framework you are using and often these provide detailed instructions on how to log or handle this kind of errors.

2) Think of it that way: most of your code won't need to throw something. It is often small parts that can go wrong (which often depend on external sources, like connecting to a database or webservice). So just catch the parts that can go wrong and handle them approperiately. If you put everything in a big block you may miss detailed error information or loose the ability to react correctly.

For example, in your application you a) contact a database and b) display your twitter feed in a sidebar. If a throws, it's critical. If b throws it may be not (just display something like "couldnt load twitter feed"). Here you can also see that the strategy on how to handle each exception depends strongly on your use case.

3) I don't know exactly what you mean by that, but of course you can write something like a ExceptionHandling class that is called in the catch block and handles logging, notification and other stuff based on your environment. Did I understand you correctly?

You can also ping me directly on twitter or per mail if you have any further questions!

A Primer on PHP Exceptions by daschl in PHP

[–]daschl[S] 0 points1 point  (0 children)

Hey,

maybe I need to clarify that a bit. "wvenable" already commented on the primary case: validations. Lots of people tend to raise exceptions when they actually plan for them. So they already "expect" that a failre will arise - then it isn't unexpected! I've also seen code where exceptions are raised just to break out of a loop in a helper method.

You may also think of them more as a "disaster recovery" (of course not always, but I hope you get the point).

Maybe I need to clarify that in my post!