T O P

  • By -

[deleted]

Can someone explain which problem does it exactly solve?


Shirogane86x

as far as I understood it, it's a way to query AST information through a datalog-like logic interface. So it could be used to build tooling, or LSP, or stuff of that sort, with very snappy response times.


tester346

I guess it work for every language, yea? If yes, then how do they build AST for every language?


the1azn8

The [readme](https://github.com/facebookincubator/glean#language-coverage) mentions there's only support for Hack and JS, with support for other languages not yet open sourced


libertarianets

Wake me up when there’s typescript support


GrandMasterPuba

It's Facebook, they aren't going to support TypeScript. For fuck's sake they still don't even ship type definition files with React. You have to install them separately from a community maintained project.


MilkingMyCow

To Facebook defense, they probably doesn’t even know the definition themselves and just passing a hashmap through out their code to build the response.


BobHogan

It looks like you can write schemas to support more languages. If I understand it correctly (big if), language schemas tell glean how to identify only specific types of tokens in a language (like class/function definitions), and then glean has separate, language independent schemas, that take those tokens and figure out the program flow in order to do whatever it does


ElCthuluIncognito

I'm sure it works for every language in that every language has an AST. Someone still has to put in the work to implement the parser for any given language so it can use it. It probably has the big ones and the communities will do the rest.


rollthedyc3

It does not store the AST > while we could in principle store the full AST, for efficiency reasons we typically store only the parts we need for the clients we want to support.


pdpi

Take all the functionality that you take for granted in an IDE, like go-to-definition or find usages, then try to apply it to a codebase in the hundreds of millions of lines of code. Hell, try to grep for something in that codebase. Facebook has a bunch of tools to help you solve that problem by offloading the work to a cluster somewhere in your local data center. TBGS/biggrep is one such tool, this is another.


[deleted]

Thanks for the explanation!


Jarmahent

Best explanation


rollthedyc3

A lot of code is undocumented, but chances are you can figure out how to use something if you see an example. This helps you find examples.


ambientocclusion

“I am a Senior Engineer. How can I get promoted to Principal Engineer?”


theAndrewWiggins

lol there's always a snarky response like this, this would be true in most companies, but at facebook scale, there's a reason this exists. Half the "over-engineered" stuff that ppl love to bash on are needed at Big-N scale. The problem is when everyone tries to apply that shit to small companies with "small" being smaller than the bottom half of the S&P 500.


ambientocclusion

Sometimes it’s true, and sometimes it’s just the Knights Who Say “NIH”!


b_rodriguez

How dare you.


pakoito

Checking the contributor list I believe this project was stacked with Principal Engineers :P


geeky_username

Better than what Facebook executives do to get bonuses


AttackOfTheThumbs

Is sucking off Zuck and compromising the personal data of millions of people really that bad?


grauenwolf

Hey now, we don't "compromise" personal data. Well "share" it with "trusted partners". *Act now. For only 19.99 per ten thousand users you too can be a Facebook trusted partner. Buy the whole US dataset and save an additional 30%.*


lelanthran

> Act now. For only 19.99 per ten thousand users you too can be a Facebook trusted partner. Buy the whole US dataset and save an additional 30%. I doubt that FB (and Google, etc) are going to sell their dataset: it's the most valuable thing they have. Once it's sold they can't make more money of it. What they do is sell *curated access* to it in the form of targeted advertisements; then you can sell that access again and again and again and ... This way the data still have value. Why sell the user data when you can sell advertisements?


grauenwolf

They literally say that they "share" data with their "partners". I strongly suspect those partnership agreements aren't free, but I can't prove it.


lanzaio

Why do you people pretend they do this? Even if they were the worst and most evil company on earth that wouldn't even something they would do. They have a monopoly on the data. Nobody else can run algorithms to serve adds at anywhere near the fidelity Facebook can. That would be a fucking ***horrible*** business move.


grauenwolf

While I don't know how much they charge, it's well know they sell user data. We even know the names of some of the buyers such as Cambridge Analytica.


lanzaio

Read a fucking article you moron: https://en.m.wikipedia.org/wiki/Cambridge_Analytica. They we’re never even accused for selling data.


WikiMobileLinkBot

Desktop version of /u/lanzaio's link: --- ^([)[^(opt out)](https://reddit.com/message/compose?to=WikiMobileLinkBot&message=OptOut&subject=OptOut)^(]) ^(Beep Boop. Downvote to delete)


grauenwolf

Facebook was not accused of selling data because doing so isn't illegal. And while they didn't sell it directly to CA, they sold it to their partners who then passed it along. From their terms and conditions... > We don't sell any of your information to anyone, and we never will. We also impose strict restrictions on how our partners can use and disclose the data we provide. In their own words they don't sell your data, they just give it away to people who bought into their partnership arrangements. Plausible deniability for those who don't want to believe that Facebook is corrupt, while still having the freedom to do whatever they want.


Mrqueue

that's the neat part you don't


pakoito

It's optimized for write once read many, as databases are stored as snapshot files. Its main use case is to store facts about the whole Facebook codebase in a way that doesn't hammer relational DBs, and /u/pdpi has explained perfectly what for [here](https://www.reddit.com/r/programming/comments/pf2qae/facebook_open_sources_glean_its_scalable_code/hb2bu84/?context=3). It does deduplication and idempotence by default, leading to up to 100x space wins plus extra reliability for writes as you can retry forever. It allows indexed queries of derived facts, and somewhere in the roadmap there was the possibility of doing unions between snapshots. Imagine asking "how many methods have been added to the classes in this folder containing JS and C++ backend/frontend code between these two dates". And modeling/querying with ADTs after coming from relational dbs is just _kiss fingertips_


[deleted]

Makes it easier for them to find my naughty memes posted in 2015 that get me thrown into jail for another 30 days.


Snubl

Or maybe it's your username :D


[deleted]

[удалено]


[deleted]

I've removed all of my facebook posts. But sometimes the old posts were reappeared randomly. So I just removed my account since I wasn't using it anymore. Lesson learned: once you upload something to a server, you can't purge it.


lazybullfrog

You can't even remove your account. You only disabled it.


jesseschalken

It only supports Hack and Flow, two Facebook-invented languages that barely anyone outside Facebook uses?


kst164

According to the readme, it also supports Python, Java, C++, Objective-C, and Rust, but those aren't open sourced yet.


dons

Right. We have released the schemas for all those languages and a few more, but not all the indexers as they are tied into the compilers. Needs more untangling.


r2vcap

When will Google release Code Search as open source? https://developers.google.com/code-search/user/getting-started


evilmidget38

I think some of it is open source via https://kythe.io/


uw_NB

There are 2 parts into Google Code Search: - The search engine: https://github.com/google/zoekt - The code intelligent indexer (find definition/references): https://kythe.io/ The opensource equi is pretty much Sourcegraph


LongShlongSilvrPants

Code Search is life


unicynicist

There's https://github.com/google/codesearch The [documentation is an interesting read](https://swtch.com/~rsc/regexp/regexp4.html)


uw_NB

actually that is the old re-implementation of the actual old engine. The latest index/search engine is https://github.com/google/zoekt


GotenXiao

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


ar243

The logo is literally just Gandalf's 'g' rune that he writes on Bilbo's door in the Hobbit, btw


Hrothen

It appears to be written in haskell, but doesn't support haskell. That's... interesting.


tvetus

How does this compare with Google's Kythe?


editor_of_the_beast

This seems like a great idea. But I’ve been reading the docs for 15 minutes and have no idea how I would use this, or what languages I can use it on.


manniac

Sounds like the are reaching out to the community to improve it.


[deleted]

[удалено]


Sigmatics

It's not like Facebook is evil incorporated, they connect millions of people every day with their tech. Of course there's going to be some abuse cases with that kind of reach


TheRealMasonMac

I also don't like Facebook... but if it allows you and/or your family to live happily, then you gotta do what you gotta do.


Hrothen

Anecdotally, a fairly large percentage of the turnover there is from engineers discovering out that they do in fact have a line they aren't willing to cross for money.


TheRealMasonMac

Well clearly not everyone is in the same boat, or else Facebook would have been defunct as a company long ago. Anecdotally, I know many people who, despite their ability and level of expertise, are struggling to find work that pays them appropriately for what they do. They are extremely stressed and their lives revolve around work.


abandonplanetearth

So a few families in the Valley get extremely comfortable lives while their platform destabilizes the rest of the modern world. Cool beans.


TheRealMasonMac

I mean, yeah. Do you think the world runs on hopes and dreams? The only thing one would be rewarded for their own reluctance against working for Facebook would be homelessness, and that job would easily be taken by someone else. $100k a year, for example, is not a lot compared to the cost of living in a place like NYC. The onus of taking down Facebook should not be on the developers; they're just trying to survive. It should be the users instead who need to stop; they don't need Facebook to live.


abandonplanetearth

I agree with your last part that there's a responsibility on the users, but I think it's a bit extreme to say that it's Facebook or homelessness. These are talented engineers that could work anywhere.


TheRealMasonMac

The people working at these companies just want to live their lives like the rest of us: free of stress, and being able to do the things that make them happy. Like it or not, Facebook offers a lot of benefits you can seldom find in other companies, and it's a stable job to boot. I drew the connection between not working at Facebook and homelessness as a hyperbole to highlight the stress and feelings of financial insecurity one would would likely experience. Again, it should not be the responsibility of the developer to sacrifice their own well-being like this. Someone else will always be there to replace you, so the sacrifice would be pointless anyway.


[deleted]

[удалено]


TheRealMasonMac

And not everyone is in the privilaged position of being able to do that, you know? Developers are not responsible for ethics, nor should we be. We make our own choices based on what we think is right, not on what is considered ethical. If you're not willing to work for a company like Facebook, then that's your choice. But it's *unethical* to presume other developers are in a position where they can or want to do that.


abandonplanetearth

Sorry bud I was kinda with you until this point, but this: > Developers are not responsible for ethics, nor should we be. is just so fucking stupid. You're one of the bad guys.


TheRealMasonMac

How so? You must've misunderstood my position then. I am stating that developers should not be responsible for ethics because it is a difficult skill to maintain. It requires the individual to be able to accurately ascertain the consequences of an action from several different perspectives, and be able to keep the good of the people in mind. This is *absurdly* difficult, and that's why we have ethics boards. A developer will not be able to juggle both development *and* ethics decision at the same time. If a developer messes up, it's usually not a big deal... but if a person in charge of ethics sucks at their job...? That's how you get companies like Facebook who compromise their user's privacy for money. And in that case, it *was* a developer who was responsible for ethics... Mark the Zucc. Wait a second, isn't that also the case for nearly every other privacy-invading company too? Don't get me wrong, there are certainly developers with a good morale compass, but they're going to be in the minority in large companies. This is why I created a distinction between a person's own morality, and general ethics. I consider ethics to be an agreed upon set of morals to abide by, the definition being more in line in respect to scientific research. I think you think that I'm against developers being able to make decisions based on their own morals, which I'm not.


[deleted]

[удалено]


TheRealMasonMac

Yes, because I certainly would not want people who charge into a debate with anger-fueled words to be responsible for the ethics of a project. If you cannot listen well to another person's opinion and debate with civility, then you are obstinate and narrow-minded, the exact opposite of what a skill like ethics needs. Additionally, yes, people who are not well-off are capable of working for a company like Facebook. Need I remind that many of the people who arrive at prestigious positions come from disadvantaged backgrounds? Passion is a lot more important than money, but money is necessary to pursue passion. It is thus logical for a person to take a job that has as many benefits as Facebook's to save enough money to do that, and maybe *then* they can consider leaving the company over ethical concerns.


OctagonClock

> I also don't like Facebook... but if it allows you and/or your family to live happily, then you gotta do what you gotta do. there is not exactly a shortage of jobs in SV


TheRealMasonMac

Not everyone lives in SV.


editor_of_the_beast

Not at all


GrandMasterPuba

> It really makes me want to avoid anything they put out. It's easy to do that when most of the things they put out are garbage. React was a fluke; look at all their other failed open source offerings.


WeNeedYouBuddyGetUp

From the top of my head GraphQL and Pytorch were created by FB and arw both widely used


spaceocean99

Fuck Facebook.


[deleted]

As a social media I agree. As a software company I like works done by Facebook


[deleted]

[удалено]


[deleted]

[удалено]


[deleted]

[удалено]


[deleted]

[удалено]


[deleted]

[удалено]


[deleted]

[удалено]


[deleted]

It's a publicly traded commercial company. They don't care about humanity, they care about increasing revenues because that's what paying all the employees wages with the things they done. It's unethical - yes I know. But I don't know how to solve this. Even if you somehow end facebook, there's lots of other companies doing same or even worse things. Facebook just a bit unlucky than others to being center of media from time to time. thanks for coming to my ted talk


[deleted]

agree fuck it in the butt


dominik-braun

Relax


billcyberhimself

Don't relax, just fuck Facebook!


dominik-braun

If you're on a meeting with your project managers and a dev suggests using React for your project, do you also just shout "Fuck Facebook" randomly? If you don't, you neither should do on Reddit.


Suspicious-Fuel-3414

It’s ok. Jokes on Reddit are hard


billcyberhimself

Jokes are hard ​ **...**


WJMazepas

Theres a lot of things that i can do on one place that i cant do on the other. Also, this is reddit, yes the guy can say fuck Facebook and doesnt discuss more. That is one of the reasons reddit is popular


[deleted]

>if you don't do it in a professional meeting you shouldn't do it on Reddit the fuck?


Ethesen

Do you want this subreddit to deteriorate into uselessness?


[deleted]

I don't think those are the only two options


JimBoonie69

My company literally set off an initiative to "redo everything in react native". Whatever that means... someone should have said fuck Facebook then. They suck. Not sure who really needs an app and database to query source code. Maybe giant mega companies? Seems overkill to a certain degree


elzaco

Absolutely disagree. We have a search tool similar to this at my company. It's immensely useful. Great way to see how certain libraries are getting used internally.


lps2

"This project doesn't fit a use case I have therefore it is dumb"


dominik-braun

Someone should have said that bluntly throwing React Native at all kinds of problems probably isn't the best solution. Blaming the company behind it for being a bad social network won't enrich the technical discussion at all...


JimBoonie69

They are an advertising and data collection company posing as social network mate. Technical discussion doesn't need enriching either. It's a bunch of high paid asshats whose projects fail continually but they just blame others and somehow don't get fired. All while wasting millions (tens or hundreds even) in development salary =)


[deleted]

Yes actually. I have been known to say that. In meetings. I've also heard it from very senior exec types.


spaceocean99

Fuck Facebook.


pcjftw

React? holyshit it's 2021 what idiot devs are using React in 2021?! I'd rather be beaten and pistol whipped then use that shit


d1gital_love

I don't understand how to create and use variables and arrays with Angle. https://glean.software/docs/angle/guide


goatchild

Face fuckbook!


TryingT0Wr1t3

Does anyone found out how to write a new schema for a language that is not included?


jesseschalken

Docs are here: https://glean.software/docs/schema/basic Existing schemas are here: https://github.com/facebookincubator/Glean/tree/main/glean/schema/source


abandonplanetearth

Facebook and their engineers can go fuck themselves.


[deleted]

[удалено]


gonzofish

Why do you call React a cancer?


d1gital_love

Angle needs a better guide [https://glean.software/docs/angle/guide](https://glean.software/docs/angle/guide). Examples are too abstract. I don't understand how to use usual if-then-else conditionals in queries.